@studio-west/component-sw 0.11.10 → 0.11.11
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 +5 -5
- package/dist/SwButton-yS_tKW9w.js +4 -0
- package/dist/{SwButton-jKDKwFV9.js → SwButton.vue_vue_type_script_setup_true_lang-aODPwFa6.js} +11 -11
- package/dist/{SwDatePicker-CJjKSM8k.js → SwDatePicker-CpmdOhuc.js} +1 -1
- package/dist/{SwDropdownItem-CtlMVgsX.js → SwDropdownItem-BE6ZRWT1.js} +1 -1
- package/dist/{SwGide-DbSSyZ-y.js → SwGide-_a5-3g_f.js} +2 -2
- package/dist/SwInput-CbNd7Vin.js +90 -0
- package/dist/{SwMessage-CovKkpf6.js → SwMessage-DdUbYQet.js} +6 -6
- package/dist/SwSection-CQe2kE0O.js +34 -0
- package/dist/SwSelect-BxbCfof-.js +1883 -0
- package/dist/{SwSlider-YncjYKPw.js → SwSlider-jWTzzPZg.js} +1 -1
- package/dist/SwSwitch-DeMdyD0-.js +47 -0
- package/dist/index-C3iiqwEz.js +188 -0
- package/dist/index.cjs +6 -1
- package/dist/index.js +1 -1
- package/package.json +6 -2
- package/src/Alert.ts +65 -0
- package/src/components/SwAlert.vue +70 -0
- package/src/components/SwButton.vue +50 -0
- package/src/components/SwButtonGroup.vue +67 -0
- package/src/components/SwCollapse.vue +36 -0
- package/src/components/SwDatePicker.vue +375 -0
- package/src/components/SwDropdown.vue +202 -0
- package/src/components/SwDropdownItem.vue +26 -0
- package/src/components/SwDropdownNew.vue +175 -0
- package/src/components/SwFormItem.vue +21 -0
- package/src/components/SwGide.vue +128 -0
- package/src/components/SwIcon.vue +16 -0
- package/src/components/SwInput.vue +100 -0
- package/src/components/SwMessage.vue +53 -0
- package/src/components/SwSection.vue +17 -0
- package/src/components/SwSelect.vue +151 -0
- package/src/components/SwSkeleton.vue +13 -0
- package/src/components/SwSkeletonItem.vue +27 -0
- package/src/components/SwSlider.vue +281 -0
- package/src/components/SwSwitch.vue +51 -0
- package/src/components/SwTable.vue +239 -0
- package/src/components/SwTableColumn.vue +25 -0
- package/src/components/SwTabs.vue +41 -0
- package/src/components/SwTabsPane.vue +44 -0
- package/src/index.ts +43 -0
- package/src/utils/index.ts +149 -0
- package/types/components.d.ts +64 -31
- package/types/index.d.ts +83 -59
- package/dist/SwInput-DCV1rrWa.js +0 -89
- package/dist/SwSection-D8ooQ21I.js +0 -37
- package/dist/SwSelect-C2RKinez.js +0 -72
- package/dist/SwSwitch-6rl1IT4p.js +0 -47
- package/dist/index-B5koqczP.js +0 -190
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ The `Component SW` library provides a set of ready-to-use UI components on Vue 3
|
|
|
58
58
|
npm install @studio-west/component-sw
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
### Глобальное подключение / global add to main.js
|
|
61
|
+
### Глобальное подключение / global add to main.js
|
|
62
62
|
```js
|
|
63
63
|
import { Library } from '@studio-west/component-sw';
|
|
64
64
|
import '@studio-west/component-sw/dist/component-sw.css';
|
|
@@ -720,10 +720,10 @@ model - состояние чекбокса (checked ) булевое знач
|
|
|
720
720
|
]
|
|
721
721
|
</script>
|
|
722
722
|
<sw-table :data="table">
|
|
723
|
-
<sw-table-
|
|
724
|
-
<sw-table-
|
|
725
|
-
<sw-table-
|
|
726
|
-
</sw-table-
|
|
723
|
+
<sw-table-column label="Label" prop="title">
|
|
724
|
+
<sw-table-column label="City" prop="city"/>
|
|
725
|
+
<sw-table-column label="District" prop="district"/>
|
|
726
|
+
</sw-table-column>
|
|
727
727
|
</sw-table>
|
|
728
728
|
```
|
|
729
729
|
---
|
package/dist/{SwButton-jKDKwFV9.js → SwButton.vue_vue_type_script_setup_true_lang-aODPwFa6.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as a, computed as o, createElementBlock as u, openBlock as f, normalizeClass as i, renderSlot as r } from "vue";
|
|
2
|
+
const c = /* @__PURE__ */ a({
|
|
3
3
|
__name: "SwButton",
|
|
4
4
|
props: {
|
|
5
|
-
class: {
|
|
6
|
-
size: {
|
|
7
|
-
type: {
|
|
5
|
+
class: { default: "" },
|
|
6
|
+
size: { default: "" },
|
|
7
|
+
type: { default: "" },
|
|
8
8
|
round: { type: Boolean, default: !1 },
|
|
9
9
|
text: { type: Boolean, default: !1 },
|
|
10
10
|
link: { type: Boolean, default: !1 },
|
|
11
|
-
href: {
|
|
11
|
+
href: { default: "" },
|
|
12
12
|
disabled: { type: Boolean, default: !1 }
|
|
13
13
|
},
|
|
14
14
|
setup(s) {
|
|
@@ -17,18 +17,18 @@ const d = {
|
|
|
17
17
|
const e = document.createElement("a");
|
|
18
18
|
e.setAttribute("href", t.href), e.setAttribute("target", "_blank"), t.disabled || e.click();
|
|
19
19
|
}
|
|
20
|
-
}, n =
|
|
20
|
+
}, n = o(() => {
|
|
21
21
|
let e = ["sw-button"];
|
|
22
22
|
return t.size.length > 0 && e.push("sw-" + t.size), t.type.length > 0 && e.push("sw-" + t.type), t.round && e.push("sw-round"), t.text && e.push("sw-text"), t.link && e.push("sw-link"), t.disabled && e.push("sw-disabled"), t.class.length > 0 && e.push(t.class), e;
|
|
23
23
|
});
|
|
24
|
-
return (e,
|
|
25
|
-
class:
|
|
24
|
+
return (e, d) => (f(), u("button", {
|
|
25
|
+
class: i(n.value),
|
|
26
26
|
onClick: l
|
|
27
27
|
}, [
|
|
28
28
|
r(e.$slots, "default")
|
|
29
29
|
], 2));
|
|
30
30
|
}
|
|
31
|
-
};
|
|
31
|
+
});
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
c as _
|
|
34
34
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as p, computed as Q, createElementBlock as r, openBlock as v, createElementVNode as o, createCommentVNode as j, withModifiers as g, renderSlot as w, createTextVNode as k, toDisplayString as f, unref as F, Fragment as $, renderList as Y, normalizeClass as A } from "vue";
|
|
2
|
-
import { p as y, a as B } from "./index-
|
|
2
|
+
import { p as y, a as B } from "./index-C3iiqwEz.js";
|
|
3
3
|
const te = { class: "sw-data-picker" }, ae = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "month_year"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { _ as u } from "./index-C3iiqwEz.js";
|
|
3
3
|
const y = {
|
|
4
4
|
__name: "SwDropdownItem",
|
|
5
5
|
props: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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
2
|
import M from "./SwDropdown-DQGTnnKw.js";
|
|
3
|
-
import f from "./SwButton-
|
|
4
|
-
import { _ as h } from "./index-
|
|
3
|
+
import { _ as f } from "./SwButton.vue_vue_type_script_setup_true_lang-aODPwFa6.js";
|
|
4
|
+
import { _ as h } from "./index-C3iiqwEz.js";
|
|
5
5
|
const B = ["src"], q = {
|
|
6
6
|
__name: "SwGide",
|
|
7
7
|
props: /* @__PURE__ */ E({
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent as x, mergeModels as i, useModel as z, ref as V, computed as _, watch as q, createElementBlock as u, openBlock as n, normalizeClass as B, createBlock as f, renderSlot as d, createCommentVNode as c, 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-C3iiqwEz.js";
|
|
3
|
+
const I = ["for"], E = {
|
|
4
|
+
key: 0,
|
|
5
|
+
title: "Это поле обязательно для заполнения."
|
|
6
|
+
}, P = ["required", "placeholder", "type", "id", "name", "size", "maxlength", "minlength", "autofocus"], R = /* @__PURE__ */ x({
|
|
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 o = z(r, "modelValue"), e = r, t = V(null), s = p, h = (l) => {
|
|
30
|
+
s("focusInput"), l.target.setSelectionRange(o.value?.length || 0, o.value?.length || 0), t.value !== null && (t.value.style.top = "-.6em");
|
|
31
|
+
}, g = (l) => {
|
|
32
|
+
(o.value?.length || 0) === 0 && t.value !== null && t.value.removeAttribute("style");
|
|
33
|
+
};
|
|
34
|
+
(o.value?.length || 0) > 0 && t.value !== null && (t.value.style.top = "-.6em");
|
|
35
|
+
const y = () => {
|
|
36
|
+
s("suffix");
|
|
37
|
+
}, v = () => {
|
|
38
|
+
s("prefix");
|
|
39
|
+
}, b = _(
|
|
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(o, (l, a) => {
|
|
46
|
+
e.type === "phone" && l && (o.value = D(l, a));
|
|
47
|
+
}), (l, a) => (n(), u("div", {
|
|
48
|
+
class: B(b.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"])) : d(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: t
|
|
60
|
+
}, [
|
|
61
|
+
C(M(e.label), 1),
|
|
62
|
+
e.required ? (n(), u("span", E, "*")) : c("", !0)
|
|
63
|
+
], 8, I)) : c("", !0),
|
|
64
|
+
S(w("input", N({
|
|
65
|
+
"onUpdate:modelValue": a[0] || (a[0] = (k) => l.model = k),
|
|
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
|
+
[$, l.model]
|
|
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"])) : d(l.$slots, "suffix", { key: 4 })
|
|
85
|
+
], 2));
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export {
|
|
89
|
+
R as default
|
|
90
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
|
2
|
-
import M from "./SwButton-
|
|
3
|
-
import { _ as N } from "./index-
|
|
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-C3iiqwEz.js";
|
|
4
4
|
const R = { key: 0 }, x = {
|
|
5
5
|
__name: "SwMessage",
|
|
6
6
|
props: /* @__PURE__ */ f({
|
|
@@ -24,7 +24,7 @@ const R = { key: 0 }, x = {
|
|
|
24
24
|
}), h(() => {
|
|
25
25
|
window.removeEventListener("click", n);
|
|
26
26
|
}), (e, t) => (c(), r("dialog", {
|
|
27
|
-
class:
|
|
27
|
+
class: _("sw-message " + s.class),
|
|
28
28
|
ref_key: "messageRef",
|
|
29
29
|
ref: l
|
|
30
30
|
}, [
|
|
@@ -44,9 +44,9 @@ const R = { key: 0 }, x = {
|
|
|
44
44
|
_: 1
|
|
45
45
|
})
|
|
46
46
|
])
|
|
47
|
-
])) :
|
|
47
|
+
])) : y("", !0),
|
|
48
48
|
a(e.$slots, "default"),
|
|
49
|
-
|
|
49
|
+
C("footer", null, [
|
|
50
50
|
a(e.$slots, "footer")
|
|
51
51
|
])
|
|
52
52
|
], 2));
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
};
|