@studio-west/component-sw 0.11.18 → 0.11.20
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/README.md +2 -2
- 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
package/dist/index-DX9QZTeL.js
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { createElementBlock as g, unref as x, openBlock as u, mergeProps as h, createElementVNode as b, ref as k, onMounted as A, onUnmounted as C, computed as P, createBlock as f, Transition as I, withCtx as j, createCommentVNode as M, normalizeClass as N, renderSlot as m, createTextVNode as E, toDisplayString as O, createApp as z, h as y, defineAsyncComponent as B } from "vue";
|
|
2
|
-
function F(e) {
|
|
3
|
-
return /^(https?:|mailto:|tel:)/.test(e);
|
|
4
|
-
}
|
|
5
|
-
function L(e, n) {
|
|
6
|
-
if (arguments.length === 0 || !e)
|
|
7
|
-
return null;
|
|
8
|
-
const o = n || "{Y}-{m}-{d} {G}:{i}:{s}";
|
|
9
|
-
let t;
|
|
10
|
-
typeof e == "object" ? t = e : (typeof e == "string" && (/^[0-9]+$/.test(e) ? e = parseInt(e, 10) : e = e.replace(new RegExp(/-/gm), "/")), typeof e == "number" && e.toString().length === 10 && (e = e * 1e3), t = new Date(e));
|
|
11
|
-
const a = "ru-RU", r = {
|
|
12
|
-
Y: t.getFullYear(),
|
|
13
|
-
m: (t.getMonth() + 1).toString().padStart(2, "0"),
|
|
14
|
-
d: t.getDate(),
|
|
15
|
-
dd: t.getDate().toString().padStart(2, "0"),
|
|
16
|
-
G: t.getHours(),
|
|
17
|
-
H: t.getHours().toString().padStart(2, "0"),
|
|
18
|
-
i: t.getMinutes().toString().padStart(2, "0"),
|
|
19
|
-
s: t.getSeconds().toString().padStart(2, "0"),
|
|
20
|
-
D: new Intl.DateTimeFormat(a, { weekday: "short" }).format(t),
|
|
21
|
-
F: new Intl.DateTimeFormat(a, { month: "long" }).format(t),
|
|
22
|
-
M: new Intl.DateTimeFormat(a, { month: "short" }).format(t)
|
|
23
|
-
};
|
|
24
|
-
return o.replace(/{(dd|[YmdGHisDFM])+}/g, (s, i) => r[i]?.toString() || s);
|
|
25
|
-
}
|
|
26
|
-
function U(e) {
|
|
27
|
-
const n = e.match(/\D.*?\D?/);
|
|
28
|
-
if (!n) return e + "T00:00:01";
|
|
29
|
-
const o = e.split(n[0]);
|
|
30
|
-
return o[0].length > 2 ? o.join("-") + "T00:00:01" : o.reverse().join("-") + "T00:00:01";
|
|
31
|
-
}
|
|
32
|
-
function V(e, n) {
|
|
33
|
-
if (n && /^\+[0-9]\s/.test(n) && e.length === 2 || /^\+0\s/.test(e)) return "";
|
|
34
|
-
if (typeof e > "u" || e.length === 0) return e;
|
|
35
|
-
const o = "+0 (___) ___-__-__";
|
|
36
|
-
let t = 0;
|
|
37
|
-
const a = o.replace(/\D/g, ""), r = e.replace(/\D/g, "");
|
|
38
|
-
let s = o.replace(/[_\d]/g, (l) => t < r.length ? r.charAt(t++) || a.charAt(t) : l);
|
|
39
|
-
t = s.indexOf("_"), t !== -1 && (t = t < 5 ? 3 : t, s = s.slice(0, t));
|
|
40
|
-
let i = o.slice(0, e.length).replace(
|
|
41
|
-
/_+/g,
|
|
42
|
-
(l) => `\\d{1,${l.length}}`
|
|
43
|
-
).replace(/[+()]/g, "\\$&");
|
|
44
|
-
return i = new RegExp(`^${i}$`), s = s.replace(/[-—]$|(\) )$/g, ""), !i.test(e) || e.length < 5 ? s : e;
|
|
45
|
-
}
|
|
46
|
-
function J(e, n = !1) {
|
|
47
|
-
const o = e.getBoundingClientRect();
|
|
48
|
-
return n ? o.left > 50 ? { right: "100%", marginRight: "10px" } : { left: "100%", marginLeft: "10px" } : { bottom: "100%", marginBottom: "10px" };
|
|
49
|
-
}
|
|
50
|
-
const G = ["href"], d = {
|
|
51
|
-
__name: "SwIcon",
|
|
52
|
-
props: {
|
|
53
|
-
prefix: { type: String, default: "icon" },
|
|
54
|
-
iconClass: { type: String, required: !0 },
|
|
55
|
-
className: { type: String, default: "" }
|
|
56
|
-
},
|
|
57
|
-
setup(e) {
|
|
58
|
-
const n = e, o = F(n.iconClass);
|
|
59
|
-
return (t, a) => x(o) ? (u(), g("div", h({
|
|
60
|
-
key: 0,
|
|
61
|
-
style: "mask: url(" + n.iconClass + ") no-repeat 50% 50%;",
|
|
62
|
-
class: "sw-external-icon svg-icon"
|
|
63
|
-
}, t.$attrs), null, 16)) : (u(), g("svg", h({
|
|
64
|
-
key: 1,
|
|
65
|
-
class: "sw-icon icon-" + (n.className || n.iconClass),
|
|
66
|
-
"aria-hidden": "true"
|
|
67
|
-
}, t.$attrs), [
|
|
68
|
-
b("use", {
|
|
69
|
-
href: "#" + n.prefix + "-" + n.iconClass
|
|
70
|
-
}, null, 8, G)
|
|
71
|
-
], 16));
|
|
72
|
-
}
|
|
73
|
-
}, R = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74
|
-
__proto__: null,
|
|
75
|
-
default: d
|
|
76
|
-
}, Symbol.toStringTag, { value: "Module" })), T = {
|
|
77
|
-
__name: "SwAlert",
|
|
78
|
-
props: {
|
|
79
|
-
message: { type: String, default: "Default message" },
|
|
80
|
-
before: { type: String, default: "" },
|
|
81
|
-
class: { type: String, default: "" },
|
|
82
|
-
after: { type: String, default: "" },
|
|
83
|
-
size: { type: String, default: "" },
|
|
84
|
-
duration: { type: Number, default: 6e3 },
|
|
85
|
-
type: { type: String, default: "info", validator: (e) => ["success", "warning", "error", "info"].includes(e) }
|
|
86
|
-
},
|
|
87
|
-
emits: ["closed"],
|
|
88
|
-
setup(e, { emit: n }) {
|
|
89
|
-
const o = e, t = n, a = k(!1);
|
|
90
|
-
let r = null;
|
|
91
|
-
const s = () => {
|
|
92
|
-
document.querySelector(".sw-alert-wrapper").togglePopover(), a.value = !0, document.querySelector(".sw-alert-wrapper").showPopover(), w();
|
|
93
|
-
}, i = () => {
|
|
94
|
-
a.value = !1, t("closed");
|
|
95
|
-
}, l = () => {
|
|
96
|
-
r && (clearTimeout(r), r = null);
|
|
97
|
-
}, D = () => {
|
|
98
|
-
w();
|
|
99
|
-
}, w = () => {
|
|
100
|
-
r = setTimeout(i, o.duration);
|
|
101
|
-
};
|
|
102
|
-
A(() => {
|
|
103
|
-
s();
|
|
104
|
-
}), C(() => {
|
|
105
|
-
r && clearTimeout(r);
|
|
106
|
-
});
|
|
107
|
-
const $ = P(() => {
|
|
108
|
-
const c = ["sw-alert"];
|
|
109
|
-
return o.size.length > 0 && c.push(`sw-${o.size}`), o.type.length > 0 && c.push(`sw-${o.type}`), o.class.length > 0 && c.push(o.class), c;
|
|
110
|
-
});
|
|
111
|
-
return (c, H) => (u(), f(I, { name: "fade" }, {
|
|
112
|
-
default: j(() => [
|
|
113
|
-
a.value ? (u(), g("div", {
|
|
114
|
-
key: 0,
|
|
115
|
-
class: N($.value),
|
|
116
|
-
onMouseenter: l,
|
|
117
|
-
onMouseleave: D
|
|
118
|
-
}, [
|
|
119
|
-
o.before.length > 0 ? (u(), f(d, {
|
|
120
|
-
key: 0,
|
|
121
|
-
"icon-class": o.before
|
|
122
|
-
}, null, 8, ["icon-class"])) : m(c.$slots, "prefix", { key: 1 }),
|
|
123
|
-
m(c.$slots, "default", {}, () => [
|
|
124
|
-
E(O(o.message), 1)
|
|
125
|
-
]),
|
|
126
|
-
o.after.length > 0 ? (u(), f(d, {
|
|
127
|
-
key: 2,
|
|
128
|
-
"icon-class": o.after,
|
|
129
|
-
onClick: i
|
|
130
|
-
}, null, 8, ["icon-class"])) : m(c.$slots, "suffix", { key: 3 }),
|
|
131
|
-
b("footer", null, [
|
|
132
|
-
m(c.$slots, "footer")
|
|
133
|
-
])
|
|
134
|
-
], 34)) : M("", !0)
|
|
135
|
-
]),
|
|
136
|
-
_: 3
|
|
137
|
-
}));
|
|
138
|
-
}
|
|
139
|
-
}, q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
140
|
-
__proto__: null,
|
|
141
|
-
default: T
|
|
142
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
143
|
-
let p = document.querySelector("div.sw-alert-wrapper");
|
|
144
|
-
function v(e = {}) {
|
|
145
|
-
p || (p = document.createElement("div"), p.className = "sw-alert-wrapper", p.setAttribute("popover", "manual"), document.body.appendChild(p));
|
|
146
|
-
const {
|
|
147
|
-
prefix: n,
|
|
148
|
-
suffix: o,
|
|
149
|
-
footer: t,
|
|
150
|
-
...a
|
|
151
|
-
} = e, r = (l) => l == null ? null : typeof l == "function" ? l : typeof l == "string" ? () => [y("span", l)] : Array.isArray(l) ? () => l : () => [l], s = z({
|
|
152
|
-
setup() {
|
|
153
|
-
return () => y(T, {
|
|
154
|
-
...a,
|
|
155
|
-
onClose: () => {
|
|
156
|
-
p && s._container && (p.removeChild(s._container), s.unmount()), e.onClose && e.onClose();
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
...n != null && { prefix: r(n) },
|
|
160
|
-
...o != null && { suffix: r(o) },
|
|
161
|
-
...t != null && { footer: r(t) }
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}), i = s.mount(document.createElement("div"));
|
|
165
|
-
p && i.$el && p.appendChild(i.$el);
|
|
166
|
-
}
|
|
167
|
-
const _ = /* @__PURE__ */ Object.assign({ "./components/SwAlert.vue": () => Promise.resolve().then(() => q), "./components/SwButton.vue": () => import("./SwButton-yS_tKW9w.js"), "./components/SwButtonGroup.vue": () => import("./SwButtonGroup-D9HH5POO.js"), "./components/SwCollapse.vue": () => import("./SwCollapse-CuN3EbT6.js"), "./components/SwDatePicker.vue": () => import("./SwDatePicker-DHP73Q1c.js"), "./components/SwDropdown.vue": () => import("./SwDropdown-DQGTnnKw.js"), "./components/SwDropdownItem.vue": () => import("./SwDropdownItem-Cua7E0JN.js"), "./components/SwDropdownNew.vue": () => import("./SwDropdownNew-CYfjZFd2.js"), "./components/SwFormItem.vue": () => import("./SwFormItem-CaA4jsoa.js"), "./components/SwGide.vue": () => import("./SwGide-BcLOtvRd.js"), "./components/SwIcon.vue": () => Promise.resolve().then(() => R), "./components/SwInput.vue": () => import("./SwInput-m4LDJuNs.js"), "./components/SwMessage.vue": () => import("./SwMessage-yOG9UmvF.js"), "./components/SwSection.vue": () => import("./SwSection-CQe2kE0O.js"), "./components/SwSelect.vue": () => import("./SwSelect-BxbCfof-.js"), "./components/SwSkeleton.vue": () => import("./SwSkeleton-B7ysp8L9.js"), "./components/SwSkeletonItem.vue": () => import("./SwSkeletonItem-CU7LvihY.js"), "./components/SwSlider.vue": () => import("./SwSlider--meCHr2D.js"), "./components/SwSwitch.vue": () => import("./SwSwitch-DeMdyD0-.js"), "./components/SwTable.vue": () => import("./SwTable-BSCqB4nS.js"), "./components/SwTableColumn.vue": () => import("./SwTableColumn-BLF5bPuJ.js"), "./components/SwTabs.vue": () => import("./SwTabs-DkSI4oAh.js"), "./components/SwTabsPane.vue": () => import("./SwTabsPane-Dwtj8g7T.js") }), S = {};
|
|
168
|
-
for (const e in _) {
|
|
169
|
-
const n = e.split("/").pop().replace(".vue", "").replace(/-(\w)/g, (o, t) => t.toUpperCase());
|
|
170
|
-
S[n] = B(() => _[e]());
|
|
171
|
-
}
|
|
172
|
-
const K = {
|
|
173
|
-
install(e) {
|
|
174
|
-
Object.keys(S).forEach((n) => {
|
|
175
|
-
e.component(n, S[n]);
|
|
176
|
-
}), e.config.globalProperties.$Alert = v, e.provide("Alert", v);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
export {
|
|
180
|
-
v as A,
|
|
181
|
-
K as L,
|
|
182
|
-
d as _,
|
|
183
|
-
L as a,
|
|
184
|
-
S as b,
|
|
185
|
-
J as c,
|
|
186
|
-
V as f,
|
|
187
|
-
U as p
|
|
188
|
-
};
|