@studio-west/component-sw 0.2.29 → 0.2.31
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-DVw7d7ww.js +72 -0
- package/dist/{SwDataPicker-Zxy4Lv1v.js → SwDataPicker-CA87wvQJ.js} +1 -1
- package/dist/{SwInput-veZYiPvK.js → SwInput-CFpMTggn.js} +1 -1
- package/dist/{index-gmNtBsqX.js → index-BE-YnNu7.js} +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/SwAlert-C-wawirc.js +0 -64
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ref as h, onMounted as v, onUnmounted as k, computed as S, resolveComponent as T, createBlock as a, openBlock as o, Transition as w, withCtx as _, createElementBlock as b, createCommentVNode as C, normalizeClass as $, renderSlot as r, createTextVNode as z, toDisplayString as x } from "vue";
|
|
2
|
+
const N = {
|
|
3
|
+
__name: "SwAlert",
|
|
4
|
+
props: {
|
|
5
|
+
message: { type: String, default: "Default message" },
|
|
6
|
+
before: { type: String, default: "" },
|
|
7
|
+
class: { type: String, default: "" },
|
|
8
|
+
// Стили
|
|
9
|
+
after: { type: String, default: "" },
|
|
10
|
+
size: { type: String, default: "" },
|
|
11
|
+
// размер small, large
|
|
12
|
+
duration: { type: Number, default: 6e3 },
|
|
13
|
+
// Время отображения в миллисекундах
|
|
14
|
+
type: { type: String, default: "info", validator: (n) => ["success", "warning", "error", "info"].includes(n) }
|
|
15
|
+
// тип по умолчанию - info | success| warning | error
|
|
16
|
+
},
|
|
17
|
+
emits: ["closed"],
|
|
18
|
+
setup(n, { emit: f }) {
|
|
19
|
+
const e = n, m = f, l = h(!1);
|
|
20
|
+
let s = null;
|
|
21
|
+
const p = () => {
|
|
22
|
+
l.value = !0, c();
|
|
23
|
+
}, i = () => {
|
|
24
|
+
m("closed"), l.value = !1;
|
|
25
|
+
}, d = () => {
|
|
26
|
+
s && (clearTimeout(s), s = null);
|
|
27
|
+
}, g = () => {
|
|
28
|
+
c();
|
|
29
|
+
}, c = () => {
|
|
30
|
+
s = setTimeout(i, e.duration);
|
|
31
|
+
};
|
|
32
|
+
v(() => {
|
|
33
|
+
p();
|
|
34
|
+
}), k(() => {
|
|
35
|
+
s && clearTimeout(s);
|
|
36
|
+
});
|
|
37
|
+
const y = S(() => {
|
|
38
|
+
const t = ["sw-alert"];
|
|
39
|
+
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;
|
|
40
|
+
});
|
|
41
|
+
return (t, B) => {
|
|
42
|
+
const u = T("svg-icon");
|
|
43
|
+
return o(), a(w, { name: "fade" }, {
|
|
44
|
+
default: _(() => [
|
|
45
|
+
l.value ? (o(), b("div", {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: $(y.value),
|
|
48
|
+
onMouseenter: d,
|
|
49
|
+
onMouseleave: g
|
|
50
|
+
}, [
|
|
51
|
+
e.before.length > 0 ? (o(), a(u, {
|
|
52
|
+
key: 0,
|
|
53
|
+
"icon-class": e.before
|
|
54
|
+
}, null, 8, ["icon-class"])) : r(t.$slots, "prefix", { key: 1 }),
|
|
55
|
+
r(t.$slots, "default", {}, () => [
|
|
56
|
+
z(x(e.message), 1)
|
|
57
|
+
]),
|
|
58
|
+
e.after.length > 0 ? (o(), a(u, {
|
|
59
|
+
key: 2,
|
|
60
|
+
"icon-class": e.after,
|
|
61
|
+
onClick: i
|
|
62
|
+
}, null, 8, ["icon-class"])) : r(t.$slots, "suffix", { key: 3 })
|
|
63
|
+
], 34)) : C("", !0)
|
|
64
|
+
]),
|
|
65
|
+
_: 3
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
N as default
|
|
72
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as f, createElementBlock as g, openBlock as h, createElementVNode as o, createCommentVNode as k, withModifiers as Y, toDisplayString as y, unref as b, Fragment as x, renderList as F, normalizeClass as G } from "vue";
|
|
2
|
-
import { p as C } from "./index-
|
|
2
|
+
import { p as C } from "./index-BE-YnNu7.js";
|
|
3
3
|
const R = { class: "sw-data-picker" }, U = { class: "month_year" }, W = { class: "text" }, X = { class: "week" }, Z = { class: "month" }, ee = ["onClick"], te = { key: 0 }, ae = { class: "month_year" }, le = { class: "text" }, ne = { class: "week" }, ue = { class: "month" }, oe = ["onClick"], ve = {
|
|
4
4
|
__name: "SwDataPicker",
|
|
5
5
|
props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createElementBlock as u, openBlock as i, mergeProps as _, createElementVNode as $, mergeModels as v, useModel as N, ref as V, computed as M, watch as A, normalizeClass as I, createBlock as x, renderSlot as S, createCommentVNode as k, withDirectives as O, createTextVNode as R, toDisplayString as T, vModelDynamic as F } from "vue";
|
|
2
|
-
import { i as P } from "./index-
|
|
2
|
+
import { i as P } from "./index-BE-YnNu7.js";
|
|
3
3
|
const U = (o, f) => {
|
|
4
4
|
const t = o.__vccOpts || o;
|
|
5
5
|
for (const [e, n] of f)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import "vue";
|
|
2
|
+
function p(t) {
|
|
2
3
|
return /^(https?:|mailto:|tel:)/.test(t);
|
|
3
4
|
}
|
|
4
|
-
function
|
|
5
|
+
function d(t, n) {
|
|
5
6
|
if (arguments.length === 0 || !t)
|
|
6
7
|
return null;
|
|
7
8
|
const a = n || "{Y}-{m}-{d} {G}:{i}:{s}";
|
|
@@ -23,6 +24,6 @@ function p(t, n) {
|
|
|
23
24
|
return a.replace(/{(dd|[YmdGHisDFM])+}/g, (g, s) => o[s]);
|
|
24
25
|
}
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
-
p
|
|
27
|
+
p as i,
|
|
28
|
+
d as p
|
|
28
29
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(V,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(V=typeof globalThis<"u"?globalThis:V||self,e(V["component-sw"]={},V.vue))})(this,function(V,e){"use strict";const v=Object.assign({"./components/SwAlert.vue":()=>Promise.resolve().then(()=>H),"./components/SwButton.vue":()=>Promise.resolve().then(()=>U),"./components/SwCollapse.vue":()=>Promise.resolve().then(()=>W),"./components/SwDataPicker.vue":()=>Promise.resolve().then(()=>re),"./components/SwDropdown.vue":()=>Promise.resolve().then(()=>ie),"./components/SwDropdownItem.vue":()=>Promise.resolve().then(()=>ce),"./components/SwFormItem.vue":()=>Promise.resolve().then(()=>de),"./components/SwInput.vue":()=>Promise.resolve().then(()=>_e),"./components/SwMessage.vue":()=>Promise.resolve().then(()=>we),"./components/SwSection.vue":()=>Promise.resolve().then(()=>be),"./components/SwSelect.vue":()=>Promise.resolve().then(()=>De),"./components/SwSkeleton.vue":()=>Promise.resolve().then(()=>Ve),"./components/SwSkeletonItem.vue":()=>Promise.resolve().then(()=>Me),"./components/SwSwitch.vue":()=>Promise.resolve().then(()=>xe),"./components/SwTabs.vue":()=>Promise.resolve().then(()=>ve),"./components/SwTabsNew.vue":()=>Promise.resolve().then(()=>Pe),"./components/SwTabsPane.vue":()=>Promise.resolve().then(()=>Ie),"./components/SwTabsPaneNew.vue":()=>Promise.resolve().then(()=>Ye)}),z={};for(const a in v){const o=a.split("/").pop().replace(".vue","").replace(/-(\w)/g,(l,n)=>n.toUpperCase());z[o]=e.defineAsyncComponent(()=>v[a]())}const R={install(a){Object.keys(z).forEach(o=>{a.component(o,z[o]),console.log(o)})}},H=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwAlert",props:{message:{type:String,default:"Default message"},before:{type:String,default:""},class:{type:String,default:""},after:{type:String,default:""},size:{type:String,default:""},duration:{type:Number,default:6e3},type:{type:String,default:"info"}},emits:["close"],setup(a,{emit:o}){const l=a,n=o,t=e.ref(!0),f=()=>{n("close"),t.value=!1};e.onMounted(()=>{setTimeout(()=>{f()},l.duration)}),e.onUnmounted(()=>{});const p=e.computed(()=>{const u=["sw-alert"];return l.size.length>0&&u.push(`sw-${l.size}`),l.type.length>0&&u.push(`sw-${l.type}`),l.class.length>0&&u.push(l.class),u});let w=document.querySelector("div.sw-wrapper-alert");return w===null&&(w=document.createElement("div"),w.className="wrapper-alert",document.body.appendChild(w)),(u,r)=>{const m=e.resolveComponent("svg-icon");return e.openBlock(),e.createBlock(e.Teleport,{to:"div.sw-wrapper-alert"},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(p.value)},[l.before.length>0?(e.openBlock(),e.createBlock(m,{key:0,"icon-class":l.before},null,8,["icon-class"])):e.renderSlot(u.$slots,"prefix",{key:1}),e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.message),1)]),l.after.length>0?(e.openBlock(),e.createBlock(m,{key:2,"icon-class":l.after,onClick:f},null,8,["icon-class"])):e.renderSlot(u.$slots,"suffix",{key:3})],2)):e.createCommentVNode("",!0)]),_:3})])}}}},Symbol.toStringTag,{value:"Module"})),j={__name:"SwButton",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},round:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},href:{type:String,default:""}},setup(a){const o=a,l=()=>{if(o.href.length>0){const t=document.createElement("a");t.setAttribute("href",o.href),t.setAttribute("target","_blank"),t.click()}},n=e.computed(()=>{let t=["sw-button"];return o.size.length>0&&t.push("sw-"+o.size),o.type.length>0&&t.push("sw-"+o.type),o.round&&t.push("sw-round"),o.text&&t.push("sw-text"),o.link&&t.push("sw-link"),o.class.length>0&&t.push(o.class),t});return(t,f)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(n.value),onClick:l},[e.renderSlot(t.$slots,"default")],2))}},U=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"})),W=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwCollapse",props:{visual:{type:Boolean,default:!0}},setup(a){e.onMounted(()=>{n.value="0px"});const o=e.ref(null),l=a,n=e.computed(()=>{var t;return l.visual?((t=o.value)==null?void 0:t.scrollHeight)+"px":"0px"});return(t,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sw-collapse",{open:l.visual}]),style:e.normalizeStyle({height:n.value}),ref_key:"collapse",ref:o},[e.renderSlot(t.$slots,"default")],6))}}},Symbol.toStringTag,{value:"Module"}));function G(a){return/^(https?:|mailto:|tel:)/.test(a)}function N(a,o){if(arguments.length===0||!a)return null;const l=o||"{Y}-{m}-{d} {G}:{i}:{s}";let n;typeof a=="object"?n=a:(typeof a=="string"&&(/^[0-9]+$/.test(a)?a=parseInt(a):a=a.replace(new RegExp(/-/gm),"/")),typeof a=="number"&&a.toString().length===10&&(a=a*1e3),n=new Date(a));const t="ru-RU",f={Y:n.getFullYear(),m:(n.getMonth()+1).toString().padStart(2,"0"),d:n.getDate(),dd:n.getDate().toString().padStart(2,"0"),G:n.getHours(),H:n.getHours().toString().padStart(2,"0"),i:n.getMinutes().toString().padStart(2,"0"),s:n.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(t,{weekday:"short"}).format(n),F:new Intl.DateTimeFormat(t,{month:"long"}).format(n),M:new Intl.DateTimeFormat(t,{month:"short"}).format(n)};return l.replace(/{(dd|[YmdGHisDFM])+}/g,(p,w)=>f[w])}const X={class:"sw-data-picker"},J={class:"month_year"},K={class:"text"},Q={class:"week"},Z={class:"month"},ee=["onClick"],te={key:0},le={class:"month_year"},oe={class:"text"},ne={class:"week"},ae={class:"month"},se=["onClick"],re=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwDataPicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:()=>"solid"}},emits:["input"],setup(a,{emit:o}){var I,F,Y,A,L,q;const l=e.ref(new Date),n=e.ref(new Date),t=a,f=o,p=e.ref(new Date().getFullYear()),w=e.ref(new Date().getMonth()),u=e.ref(new Date().getFullYear()),r=e.ref(new Date().getMonth()),m=e.ref([]),E=e.ref(0),_=e.ref(0),i=e.ref(-1),h=e.ref(-1),k=e.ref(navigator.languages||"ru"),B=/en|zh|ja|he/.test(k.value)?0:1,S=t.range==="range"?2:1,b=g=>{const c=g.split(g.match(/\D.*?\D?/));return c[0].length>2?c.join("-")+"T00:00:01":c.reverse().join("-")+"T00:00:01"};typeof((I=t.data)==null?void 0:I.startDate)<"u"&&((F=t.data)==null?void 0:F.startDate)!==null&&(l.value=new Date(b(t.data.startDate)),p.value=l.value.getFullYear(),r.value=l.value.getMonth()),typeof((Y=t.data)==null?void 0:Y.endDate)<"u"&&((A=t.data)==null?void 0:A.endDate)!==null&&(n.value=new Date(b(t.data.endDate)),u.value=n.value.getFullYear(),w.value=n.value.getMonth());const C=()=>{var s;let g=new Date(p.value,r.value,0);for(let d=g.getDate()-g.getDay()+B;d<=g.getDate()&&g.getDay()!==6+B;d++)E.value++,m.value.push({day:d,month:g.getMonth(),year:g.getFullYear(),class:[]});for(let d=1;d<=new Date(p.value,r.value+1,0).getDate();d++)E.value++,m.value.push({day:d,month:r.value,year:p.value,class:[]});if(t.range==="range"){_.value=new Date(p.value,r.value+2,0);for(let d=1;d<=_.value.getDate();d++)m.value.push({day:d,month:_.value.getMonth(),year:_.value.getFullYear(),class:[]})}let c=new Date(p.value,r.value+S,1);console.log(c.getDay());for(let d=1;d<=(7-c.getDay()+B)%7&&c.getDay()!==B;d++)m.value.push({day:d,month:c.getMonth(),year:c.getFullYear(),class:[]});typeof((s=t.data)==null?void 0:s.holiday)<"u"&&t.data.holiday.length!==0&&(t.data.holiday.preholidays.forEach(d=>{let y=d.split("-");const D=m.value.findIndex($=>$.year==y[0]&&$.month+1==y[1]&&$.day==y[2]);D!==-1&&(m.value[D].class[0]="preholiday")}),t.data.holiday.holidays.forEach(d=>{let y=d.split("-");const D=m.value.findIndex($=>$.year==y[0]&&$.month+1==y[1]&&$.day==y[2]);D!==-1&&(m.value[D].class[0]="weekend")}),t.data.holiday.holiday.forEach(d=>{let y=d.split("-");const D=m.value.findIndex($=>$.year==y[0]&&$.month+1==y[1]&&$.day==y[2]);D!==-1&&(m.value[D].class[0]="holiday")}),t.data.holiday.nowork.forEach(d=>{let y=d.split("-");const D=m.value.findIndex($=>$.year==y[0]&&$.month+1==y[1]&&$.day==y[2]);D!==-1&&(m.value[D].class[0]="nowork")}))},M=(g,c)=>{let s=g-c+1;for(let d=0;d<=g-c;d++)m.value[d+c].class[0]==="holiday"&&s--;return s},x=(g,c)=>{console.log(c);const s=N(new Date(g.year,g.month,g.day),"{dd}.{m}.{Y}");if(t.range==="range")if(console.log(i.value),h.value!==-1){if(h.value<=i.value)for(let d=h.value;d<=i.value;d++)m.value[d].class[1]="";else for(let d=i.value;d<=h.value;d++)m.value[d].class[1]="";i.value=c,h.value=-1,m.value[c].class[1]="active"}else if(i.value!==-1){if(h.value=c,h.value>=i.value)for(let y=i.value+1;y<c;y++)m.value[y].class[1]="select";else for(let y=c+1;y<i.value;y++)m.value[y].class[1]="select";m.value[c].class[1]="active";let d=N(new Date(m.value[i.value].year,m.value[i.value].month,m.value[i.value].day),"{dd}.{m}.{Y}");i.value>c?f("input",{dateStart:s,dateEnd:d,count:M(i.value,c)}):f("input",{dateStart:d,dateEnd:s,count:M(c,i.value)})}else i.value=c,m.value[c].class[1]="active";else i.value!==-1&&(m.value[i.value].class[1]=""),i.value=c,m.value[c].class[1]="active",f("input",{dateStart:s,count:1})};if(C(),typeof((L=t.data)==null?void 0:L.startDate)<"u"&&(i.value=m.value.findIndex(g=>g.day===l.value.getDate()&&g.month===r.value&&g.year===p.value),m.value[i.value].class[1]="active"),typeof((q=t.data)==null?void 0:q.endDate)<"u"&&t.range==="range"){h.value=m.value.findIndex(g=>g.day===n.value.getDate()&&g.month===w.value&&g.year===u.value),m.value[h.value].class[1]="active";for(let g=i.value+1;g<h.value;g++)m.value[g].class[1]="select"}const T=(g,c)=>{Ae(g,c)&&(m.value=[],E.value=0,l.value=new Date(g,c,1),p.value=l.value.getFullYear(),r.value=l.value.getMonth(),C())},Ae=(g,c)=>{if(!t.limitation)return!0;if(t.limitation[0].dateStart){console.log(t.limitation[0].dateStart);let s=t.limitation[0].dateStart.split(t.limitation[0].dateStart.match(/\D.*?\D?/));if(s[0].length>2&&s.reverse(),parseInt(s[2])>g||parseInt(s[2])===g&&parseInt(s[1])>c+1)return!1}if(t.limitation[t.limitation.length-1].dateEnd){console.log(t.limitation[t.limitation.length-1].dateEnd);let s=t.limitation[t.limitation.length-1].dateEnd.split(t.limitation[t.limitation.length-1].dateEnd.match(/\D.*?\D?/));if(s[0].length>2&&s.reverse(),parseInt(s[2])<g||parseInt(s[2])===g&&parseInt(s[1])<c+S)return!1}return!0};return(g,c)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",null,[e.createElementVNode("p",J,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[0]||(c[0]=e.withModifiers(s=>T(p.value-1,r.value),["prevent"]))},"«"),e.createElementVNode("button",{onClick:c[1]||(c[1]=e.withModifiers(s=>T(p.value,r.value-1),["prevent"]))},"‹")]),e.createElementVNode("span",K,[e.createElementVNode("button",null,e.toDisplayString(p.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(N)(l.value.setMonth(r.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[2]||(c[2]=e.withModifiers(s=>T(p.value,r.value+1),["prevent"]))},"›"),e.createElementVNode("button",{onClick:c[3]||(c[3]=e.withModifiers(s=>T(p.value+1,r.value),["prevent"]))},"»")])]),e.createElementVNode("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(s,d)=>e.createElementVNode("button",{key:d,class:"disabled"},e.toDisplayString(e.unref(N)(new Date(1970,1,s+e.unref(B)),"{D}")),1)),64))]),e.createElementVNode("div",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(s,d)=>{var y,D;return e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[d<E.value+(7-new Date(p.value,r.value+1,1).getDay()+e.unref(B))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(s.month===r.value&&(!t.limitation||new Date(s.year,s.month,s.day+1).getTime()>new Date(b((y=t.limitation[0])==null?void 0:y.dateStart)).getTime()&&new Date(s.year,s.month,s.day).getTime()<new Date(b((D=t.limitation[0])==null?void 0:D.dateEnd)).getTime())?s.class:"disabled"),onClick:()=>{s.month===r.value&&x(s,d)}},e.toDisplayString(s.day),11,ee)):e.createCommentVNode("",!0)],64)}),128))])]),t.range==="range"?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("p",le,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[4]||(c[4]=s=>T(p.value-1,r.value))},"«"),e.createElementVNode("button",{onClick:c[5]||(c[5]=s=>T(p.value,r.value-1))},"‹")]),e.createElementVNode("span",oe,[e.createElementVNode("button",null,e.toDisplayString(new Date(p.value,r.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(N)(l.value.setMonth(r.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[6]||(c[6]=s=>T(p.value,r.value+1))},"›"),e.createElementVNode("button",{onClick:c[7]||(c[7]=s=>T(p.value+1,r.value))},"»")])]),e.createElementVNode("div",ne,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(s,d)=>e.createElementVNode("button",{key:d,class:"disabled"},e.toDisplayString(e.unref(N)(new Date(1970,1,s+e.unref(B)),"{D}")),1)),64))]),e.createElementVNode("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(s,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[d>=E.value-(7+new Date(p.value,r.value+1,1).getDay()-e.unref(B))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(s.month===_.value.getMonth()&&(!t.limitation||new Date(s.year,s.month,s.day+1).getTime()>new Date(b(t.limitation[0].dateStart)).getTime()&&new Date(s.year,s.month,s.day).getTime()<new Date(b(t.limitation[0].dateEnd)).getTime())?s.class:"disabled"),onClick:()=>{s.month===_.value.getMonth()&&x(s,d)}},e.toDisplayString(s.day),11,se)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}}},Symbol.toStringTag,{value:"Module"})),ie=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwDropdown",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},trigger:{type:String,default:"click"},placement:{type:String,default:"bottom-left"},maxWidth:{type:Number,default:0},manual:{type:Boolean,default:!1}},setup(a){const o=a,l=e.ref(!1),n=e.ref(null),t=e.ref(null),f=e.ref({}),p=e.computed(()=>{let _=["sw-dropdown"];return o.size.length>0&&_.push("sw-"+o.size),o.type.length>0&&_.push("sw-"+o.type),_});e.watch(()=>o.manual,_=>{l.value=_,console.log("watch",l.value)});const w=async()=>{if(await e.nextTick(),!t.value)return;const _=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft;document.body.style.position="fixed",document.body.style.top=`-${_}px`,document.body.style.left=`-${i}px`,t.value.focus(),t.value.addEventListener("blur",()=>l.value=!1),document.body.style.position="",document.body.style.top="",document.body.style.left="",document.documentElement.scrollTop=_,document.documentElement.scrollLeft=i;const h=n.value.getBoundingClientRect(),k=t.value.offsetHeight,B=t.value.offsetWidth;console.log("popupHeight",k),console.log("popupWidth",B);let S=h.left+h.width/2+i,b=h.top+h.height/2+_;const[C,M]=o.placement.split("-",2);switch(console.log(o.placement),C){case"bottom":b=b+h.height/2+8;break;case"top":b=b-h.height/2-8-k;break;case"left":S=S-B-h.width/2-8,b=b-k/2;break;case"right":S=S+h.width/2+8,b=b-k/2;break}switch(M){case"left":S=S-h.width/2;break;case"right":S=S-B+h.width/2;break}S<0&&(S=0),b<0&&(b=0),f.value={position:"absolute",top:`${b}px`,left:`${S}px`,maxWidth:o.maxWidth===0?"":`${o.maxWidth}px`}},u=async()=>{o.trigger==="click"&&(l.value=!l.value),l.value&&await w()},r=async()=>{o.trigger==="hover"&&(l.value=!l.value),l.value&&await w()},m=async()=>{o.trigger==="context"&&(l.value=!l.value),l.value&&await w()},E=()=>{l.value&&w()};return e.onMounted(()=>window.addEventListener("resize",E)),e.onUnmounted(()=>window.removeEventListener("resize",E)),(_,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(p.value),onClick:i[0]||(i[0]=e.withModifiers(h=>u(),["stop"])),onMouseover:i[1]||(i[1]=e.withModifiers(h=>r(),["stop"])),onMouseleave:i[2]||(i[2]=e.withModifiers(h=>r(),["stop"])),onContextmenu:i[3]||(i[3]=e.withModifiers(h=>m(),["stop"])),ref_key:"dropdownRef",ref:n},[e.renderSlot(_.$slots,"default"),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("ul",{key:0,ref_key:"popupRef",ref:t,class:e.normalizeClass(["sw-dropdown-popup",o.class]),style:e.normalizeStyle(f.value),tabindex:"-1"},[e.renderSlot(_.$slots,"dropdown")],6)):e.createCommentVNode("",!0)]))],34))}}},Symbol.toStringTag,{value:"Module"})),ce=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwDropdownItem",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},iconBefore:{type:String,default:""}},setup(a){const o=a,l=e.computed(()=>{let n=["sw-dropdown-item"];return o.size.length>0&&n.push("sw-"+o.size),o.type.length>0&&n.push("sw-"+o.type),o.class.length>0&&n.push(o.class),n});return(n,t)=>{const f=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(l.value)},[e.createVNode(f,{"icon-class":a.iconBefore},null,8,["icon-class"]),e.renderSlot(n.$slots,"default")],2)}}}},Symbol.toStringTag,{value:"Module"})),de=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwFormItem",props:{class:{type:String,default:""},type:{type:String,default:""}},setup(a){const o=a,l=e.computed(()=>{let n=["sw-form-item"];return o.type.length>0&&n.push("sw-"+o.type),o.class.length>0&&n.push(o.class),n});return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value)},[e.renderSlot(n.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),pe=(a,o)=>{const l=a.__vccOpts||a;for(const[n,t]of o)l[n]=t;return l},me={name:"SvgIcon",props:{prefix:{type:String,default:"icon"},iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExt(){return G(this.iconClass)}}},fe=["href"];function ue(a,o,l,n,t,f){return f.isExt?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0,style:"mask: url("+l.iconClass+") no-repeat 50% 50%;",class:"svg-external-icon svg-icon"},a.$attrs),null,16)):(e.openBlock(),e.createElementBlock("svg",e.mergeProps({key:1,class:"svg-icon "+l.className,"aria-hidden":"true"},a.$attrs),[e.createElementVNode("use",{href:"#"+l.prefix+"-"+l.iconClass},null,8,fe)],16))}const P=pe(me,[["render",ue]]),ge=["for"],he={key:0,title:"Это поле обязательно для заполнения."},ye=["required","placeholder","type","id","name"],_e=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwInput",props:e.mergeModels({before:{type:String,default:""},after:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:""},name:{type:String,required:!0},class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:"text"},required:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["suffix","prefix"],["update:modelValue"]),setup(a,{emit:o}){var _;const l=e.useModel(a,"modelValue"),n=a,t=e.ref(null),f=o,p=i=>{i.target.setSelectionRange(l.value.length,l.value.length),t.value!==null&&(t.value.style.top="-.6em")},w=i=>{var h;((h=l.value)==null?void 0:h.length)===0&&t.value!==null&&t.value.removeAttribute("style")};((_=l.value)==null?void 0:_.length)>0&&t.value!==null&&(t.value.style.top="-.6em");const u=()=>{f("suffix")},r=()=>{f("prefix")},m=e.computed(()=>{let i=["sw-input"];return n.size.length>0&&i.push("sw-"+n.size),n.class.length>0&&i.push(n.class),i});e.watch(l,(i,h)=>{n.type==="phone"&&(l.value=E(i,h))});const E=(i,h)=>{if(/^\+[0-9]\s/.test(h)&&i.length===2||/^\+0\s/.test(i))return"";const k=i;if(typeof k>"u"||k.length===0)return k;const B="+0 (___) ___-__-__";let S=0;const b=B.replace(/\D/g,""),C=k.replace(/\D/g,"");let M=B.replace(/[_\d]/g,T=>S<C.length?C.charAt(S++)||b.charAt(S):T);S=M.indexOf("_"),S!==-1&&(S=S<5?3:S,M=M.slice(0,S));let x=B.slice(0,k.length).replace(/_+/g,T=>`\\d{1,${T.length}}`).replace(/[+()]/g,"\\$&");if(x=new RegExp(`^${x}$`),M=M.replace(/[-—]$|(\) )$/g,""),!x.test(k)||k.length<5)return M};return(i,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value)},[n.before.length>0?(e.openBlock(),e.createBlock(P,{key:0,"icon-class":n.before,onClick:r},null,8,["icon-class"])):e.renderSlot(i.$slots,"prefix",{key:1}),n.label.length>0?(e.openBlock(),e.createElementBlock("label",{key:2,for:n.name,ref_key:"lab",ref:t},[e.createTextVNode(e.toDisplayString(n.label),1),n.required?(e.openBlock(),e.createElementBlock("span",he,"*")):e.createCommentVNode("",!0)],8,ge)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[0]||(h[0]=k=>l.value=k),required:n.required,placeholder:n.required&&n.label.length===0?n.placeholder+"*":n.placeholder,type:n.type,id:n.name,name:n.name,size:"60",onFocus:p,onBlur:w,maxlength:"128"},null,40,ye),[[e.vModelDynamic,l.value]]),n.after.length>0?(e.openBlock(),e.createBlock(P,{key:3,"icon-class":n.after,onClick:u},null,8,["icon-class"])):e.renderSlot(i.$slots,"suffix",{key:4})],2))}}},Symbol.toStringTag,{value:"Module"})),Se={key:0},we=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwMessage",props:e.mergeModels({name:{type:String,default:""},class:{type:String,default:""},iconAfter:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=e.useModel(a,"modelValue"),l=a,n=e.ref(null);return(t,f)=>{const p=e.resolveComponent("svg-icon");return o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sw-message",l.class]),ref_key:"messageRef",ref:n},[l.name.length>0?(e.openBlock(),e.createElementBlock("header",Se,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(l.name)+" ",1),e.createVNode(j,{link:"",type:"primary",onClick:f[0]||(f[0]=w=>o.value=!1)},{default:e.withCtx(()=>[e.createVNode(p,{"icon-class":l.iconAfter},null,8,["icon-class"])]),_:1})])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},()=>[f[1]||(f[1]=e.createTextVNode("111222"))]),e.createElementVNode("footer",null,[e.renderSlot(t.$slots,"footer")])],2)):e.createCommentVNode("",!0)}}}},Symbol.toStringTag,{value:"Module"})),be=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSection",props:{name:{type:String,default:""},class:{type:String,default:""},iconAfter:{type:String,default:""}},setup(a){const o=a;return(l,n)=>{const t=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(o.class)},[e.createElementVNode("header",null,[e.renderSlot(l.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(o.name)+" ",1),e.createVNode(t,{"icon-class":o.iconAfter},null,8,["icon-class"])])]),e.renderSlot(l.$slots,"default"),e.createElementVNode("footer",null,[e.renderSlot(l.$slots,"footer")])],2)}}}},Symbol.toStringTag,{value:"Module"})),ke={class:"popup"},Be={class:"wrapper"},Ee={class:"scrollbar"},$e=["onClick"],De=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSelect",props:e.mergeModels({name:{type:String,default:""},class:{type:String,default:""},placeholder:{type:String,default:""},token:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=e.ref({fullText:""}),l=e.ref(!1),n=e.ref([]),t=e.useModel(a,"modelValue"),f=a;e.watch(t.text,u=>{u.length>3&&(o.value.fullText=u)}),e.watch(o.value.fullText,(u,r)=>{l.value=u.length>3&&u.length>r.length,u.length>3&&p()});const p=()=>{let u="https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address";console.log(o.value.fullText),axios.post(u,{query:o.value.fullText},{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Token "+f.token}}).then(r=>{console.log(r.data.suggestions),n.value=r.data.suggestions,n.value.length===1&&w(n.value[0])}).catch(r=>{console.log(r)})},w=u=>{o.value.fullText=u.value,l.value=!1;const r={};r.text=u.value,r.coords=[Number(u.data.geo_lat),Number(u.data.geo_lon)],r.suggestion=u.data,t.value=r};return(u,r)=>{const m=e.resolveComponent("sw-input");return e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(m,{size:"large",modelValue:o.value.fullText,"onUpdate:modelValue":r[0]||(r[0]=E=>o.value.fullText=E),placeholder:a.placeholder},null,8,["modelValue","placeholder"]),e.withDirectives(e.createElementVNode("div",Be,[e.createElementVNode("ul",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(E,_)=>(e.openBlock(),e.createElementBlock("li",{tabindex:"1",key:_,onClick:i=>w(E)},e.toDisplayString(E.value),9,$e))),128))])],512),[[e.vShow,l.value]])])}}}},Symbol.toStringTag,{value:"Module"})),Te={key:0},O={__name:"SwSkeletonItem",props:{width:{type:String,default:"100"},class:{type:String,default:""},animate:{type:Boolean,default:!1},size:{type:String,default:""}},setup(a){const o=a,l=e.computed(()=>{let t=["sw-skeleton-item"];return o.size.length>0&&t.push("sw-"+o.size),o.animate&&t.push("sw-animate"),o.class.length>0&&t.push(o.class),t}),n=e.computed(()=>({width:o.width+"%"}));return(t,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value),style:e.normalizeStyle(n.value)},[o.animate?(e.openBlock(),e.createElementBlock("div",Te)):e.createCommentVNode("",!0)],6))}},Me=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"})),Ve=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSkeleton",props:{class:{type:String,default:""},visual:{type:Boolean,default:!1}},setup(a){const o=a;return(l,n)=>o.visual?e.renderSlot(l.$slots,"default",{key:0},()=>[n[0]||(n[0]=e.createTextVNode("1"))]):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["sw-skeleton",o.class])},[e.renderSlot(l.$slots,"skeleton",{},()=>[e.createVNode(O,{animate:"",size:"small"})])],2))}}},Symbol.toStringTag,{value:"Module"})),Ce=["name","id"],Ne=["for","data-onlabel","data-offlabel"],xe=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSwitch",props:e.mergeModels({id:{type:String,default:"checkbox"},class:{type:String,default:""},name:{type:String,default:""},on:{type:String,default:""},off:{type:String,default:""},size:{type:String,default:""},checkbox:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=e.useModel(a,"modelValue"),l=a,n=e.computed(()=>{let t=["sw-switch"];return l.size.length>0&&t.push("sw-"+l.size),l.checkbox&&t.push("sw-checkbox"),l.class.length>0&&t.push(l.class),t});return(t,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(n.value)},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",name:l.name,class:"sw-control",id:l.id,"onUpdate:modelValue":f[0]||(f[0]=p=>o.value=p)},null,8,Ce),[[e.vModelCheckbox,o.value]]),e.createElementVNode("label",{for:l.id,class:"sw-label","data-onlabel":l.on,"data-offlabel":l.off},null,8,Ne),e.renderSlot(t.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),ze=["onClick"],ve=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabs",props:e.mergeModels({name:{type:String},class:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["tab-click"],["update:modelValue"]),setup(a,{emit:o}){e.ref(0);const l=e.ref([]),n=a,t=e.useModel(a,"modelValue"),f=o;return l.value=e.useSlots().default().filter(p=>p.type.__name==="SwTabsPane"),e.provide("activeTab",t),e.provide("tabs",l),(p,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("sw-tabs "+n.class)},[e.createElementVNode("header",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(u,r)=>(e.openBlock(),e.createElementBlock("span",{key:r,class:e.normalizeClass([{active:t.value===r}]),onClick:m=>{t.value=r,f("tab-click",r)}},e.toDisplayString(u.props.label||u.props.title),11,ze))),128))]),e.renderSlot(p.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),je=["onClick"],Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsNew",props:e.mergeModels({name:{type:String},class:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["tab-click"],["update:modelValue"]),setup(a,{emit:o}){e.ref(0);const l=e.ref([]),n=a,t=e.useModel(a,"modelValue"),f=o;return e.provide("activeTab",t),e.provide("tabs",l),e.provide("registerTab",p=>{l.value.push(p)}),(p,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("sw-tabs "+n.class)},[e.createElementVNode("header",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(u,r)=>(e.openBlock(),e.createElementBlock("span",{key:r,class:e.normalizeClass([{active:t.value===r}]),onClick:m=>{t.value=r,f("tab-click",r)}},e.toDisplayString(u.props.label||u.props.title),11,je))),128))]),e.renderSlot(p.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),Oe={key:0,class:"tab-content"},Ie=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsPane",props:{title:{type:String,required:!0}},setup(a){const o=a,l=e.inject("activeTab"),n=e.inject("tabs"),t=e.computed(()=>{const f=n.value.findIndex(p=>p.props.title===o.title);return l.value===f});return(f,p)=>t.value?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(f.$slots,"default")])):e.createCommentVNode("",!0)}}},Symbol.toStringTag,{value:"Module"})),Fe={key:0,class:"tab-content"},Ye=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsPaneNew",props:{label:{type:String,required:!0},title:{type:String}},setup(a){const o=a,l=e.inject("registerTab");if(!l)throw new Error("SwTabsPane must be used inside SwTabs");l({props:o});const n=e.inject("activeTab");if(!e.inject("tabs"))throw new Error("Tabs array is not provided by SwTabs");const f=e.inject("tabs").value.length-1;return(p,w)=>e.unref(n)===f?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(p.$slots,"default")])):e.createCommentVNode("",!0)}}},Symbol.toStringTag,{value:"Module"}));V.components=z,V.default=R,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(V,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(V=typeof globalThis<"u"?globalThis:V||self,e(V["component-sw"]={},V.vue))})(this,function(V,e){"use strict";const v=Object.assign({"./components/SwAlert.vue":()=>Promise.resolve().then(()=>H),"./components/SwButton.vue":()=>Promise.resolve().then(()=>U),"./components/SwCollapse.vue":()=>Promise.resolve().then(()=>W),"./components/SwDataPicker.vue":()=>Promise.resolve().then(()=>re),"./components/SwDropdown.vue":()=>Promise.resolve().then(()=>ie),"./components/SwDropdownItem.vue":()=>Promise.resolve().then(()=>ce),"./components/SwFormItem.vue":()=>Promise.resolve().then(()=>de),"./components/SwInput.vue":()=>Promise.resolve().then(()=>_e),"./components/SwMessage.vue":()=>Promise.resolve().then(()=>we),"./components/SwSection.vue":()=>Promise.resolve().then(()=>be),"./components/SwSelect.vue":()=>Promise.resolve().then(()=>De),"./components/SwSkeleton.vue":()=>Promise.resolve().then(()=>Ve),"./components/SwSkeletonItem.vue":()=>Promise.resolve().then(()=>Me),"./components/SwSwitch.vue":()=>Promise.resolve().then(()=>xe),"./components/SwTabs.vue":()=>Promise.resolve().then(()=>ve),"./components/SwTabsNew.vue":()=>Promise.resolve().then(()=>Pe),"./components/SwTabsPane.vue":()=>Promise.resolve().then(()=>Ie),"./components/SwTabsPaneNew.vue":()=>Promise.resolve().then(()=>Ye)}),z={};for(const a in v){const o=a.split("/").pop().replace(".vue","").replace(/-(\w)/g,(l,n)=>n.toUpperCase());z[o]=e.defineAsyncComponent(()=>v[a]())}const q={install(a){Object.keys(z).forEach(o=>{a.component(o,z[o]),console.log(o)})}},H=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwAlert",props:{message:{type:String,default:"Default message"},before:{type:String,default:""},class:{type:String,default:""},after:{type:String,default:""},size:{type:String,default:""},duration:{type:Number,default:6e3},type:{type:String,default:"info",validator:a=>["success","warning","error","info"].includes(a)}},emits:["closed"],setup(a,{emit:o}){const l=a,n=o,t=e.ref(!1);let m=null;const p=()=>{t.value=!0,f()},w=()=>{n("closed"),t.value=!1},y=()=>{m&&(clearTimeout(m),m=null)},r=()=>{f()},f=()=>{m=setTimeout(w,l.duration)};e.onMounted(()=>{p()}),e.onUnmounted(()=>{m&&clearTimeout(m)});const k=e.computed(()=>{const h=["sw-alert"];return l.size.length>0&&h.push(`sw-${l.size}`),l.type.length>0&&h.push(`sw-${l.type}`),l.class.length>0&&h.push(l.class),h});return(h,i)=>{const u=e.resolveComponent("svg-icon");return e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(k.value),onMouseenter:y,onMouseleave:r},[l.before.length>0?(e.openBlock(),e.createBlock(u,{key:0,"icon-class":l.before},null,8,["icon-class"])):e.renderSlot(h.$slots,"prefix",{key:1}),e.renderSlot(h.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.message),1)]),l.after.length>0?(e.openBlock(),e.createBlock(u,{key:2,"icon-class":l.after,onClick:w},null,8,["icon-class"])):e.renderSlot(h.$slots,"suffix",{key:3})],34)):e.createCommentVNode("",!0)]),_:3})}}}},Symbol.toStringTag,{value:"Module"})),j={__name:"SwButton",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},round:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},href:{type:String,default:""}},setup(a){const o=a,l=()=>{if(o.href.length>0){const t=document.createElement("a");t.setAttribute("href",o.href),t.setAttribute("target","_blank"),t.click()}},n=e.computed(()=>{let t=["sw-button"];return o.size.length>0&&t.push("sw-"+o.size),o.type.length>0&&t.push("sw-"+o.type),o.round&&t.push("sw-round"),o.text&&t.push("sw-text"),o.link&&t.push("sw-link"),o.class.length>0&&t.push(o.class),t});return(t,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(n.value),onClick:l},[e.renderSlot(t.$slots,"default")],2))}},U=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"})),W=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwCollapse",props:{visual:{type:Boolean,default:!0}},setup(a){e.onMounted(()=>{n.value="0px"});const o=e.ref(null),l=a,n=e.computed(()=>{var t;return l.visual?((t=o.value)==null?void 0:t.scrollHeight)+"px":"0px"});return(t,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sw-collapse",{open:l.visual}]),style:e.normalizeStyle({height:n.value}),ref_key:"collapse",ref:o},[e.renderSlot(t.$slots,"default")],6))}}},Symbol.toStringTag,{value:"Module"}));function G(a){return/^(https?:|mailto:|tel:)/.test(a)}function N(a,o){if(arguments.length===0||!a)return null;const l=o||"{Y}-{m}-{d} {G}:{i}:{s}";let n;typeof a=="object"?n=a:(typeof a=="string"&&(/^[0-9]+$/.test(a)?a=parseInt(a):a=a.replace(new RegExp(/-/gm),"/")),typeof a=="number"&&a.toString().length===10&&(a=a*1e3),n=new Date(a));const t="ru-RU",m={Y:n.getFullYear(),m:(n.getMonth()+1).toString().padStart(2,"0"),d:n.getDate(),dd:n.getDate().toString().padStart(2,"0"),G:n.getHours(),H:n.getHours().toString().padStart(2,"0"),i:n.getMinutes().toString().padStart(2,"0"),s:n.getSeconds().toString().padStart(2,"0"),D:new Intl.DateTimeFormat(t,{weekday:"short"}).format(n),F:new Intl.DateTimeFormat(t,{month:"long"}).format(n),M:new Intl.DateTimeFormat(t,{month:"short"}).format(n)};return l.replace(/{(dd|[YmdGHisDFM])+}/g,(p,w)=>m[w])}const X={class:"sw-data-picker"},J={class:"month_year"},K={class:"text"},Q={class:"week"},Z={class:"month"},ee=["onClick"],te={key:0},le={class:"month_year"},oe={class:"text"},ne={class:"week"},ae={class:"month"},se=["onClick"],re=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwDataPicker",props:{data:Object,limitation:{type:[Boolean,Array],default:()=>!1},range:{type:String,default:()=>"solid"}},emits:["input"],setup(a,{emit:o}){var I,F,Y,A,L,R;const l=e.ref(new Date),n=e.ref(new Date),t=a,m=o,p=e.ref(new Date().getFullYear()),w=e.ref(new Date().getMonth()),y=e.ref(new Date().getFullYear()),r=e.ref(new Date().getMonth()),f=e.ref([]),k=e.ref(0),h=e.ref(0),i=e.ref(-1),u=e.ref(-1),B=e.ref(navigator.languages||"ru"),E=/en|zh|ja|he/.test(B.value)?0:1,S=t.range==="range"?2:1,b=g=>{const c=g.split(g.match(/\D.*?\D?/));return c[0].length>2?c.join("-")+"T00:00:01":c.reverse().join("-")+"T00:00:01"};typeof((I=t.data)==null?void 0:I.startDate)<"u"&&((F=t.data)==null?void 0:F.startDate)!==null&&(l.value=new Date(b(t.data.startDate)),p.value=l.value.getFullYear(),r.value=l.value.getMonth()),typeof((Y=t.data)==null?void 0:Y.endDate)<"u"&&((A=t.data)==null?void 0:A.endDate)!==null&&(n.value=new Date(b(t.data.endDate)),y.value=n.value.getFullYear(),w.value=n.value.getMonth());const C=()=>{var s;let g=new Date(p.value,r.value,0);for(let d=g.getDate()-g.getDay()+E;d<=g.getDate()&&g.getDay()!==6+E;d++)k.value++,f.value.push({day:d,month:g.getMonth(),year:g.getFullYear(),class:[]});for(let d=1;d<=new Date(p.value,r.value+1,0).getDate();d++)k.value++,f.value.push({day:d,month:r.value,year:p.value,class:[]});if(t.range==="range"){h.value=new Date(p.value,r.value+2,0);for(let d=1;d<=h.value.getDate();d++)f.value.push({day:d,month:h.value.getMonth(),year:h.value.getFullYear(),class:[]})}let c=new Date(p.value,r.value+S,1);console.log(c.getDay());for(let d=1;d<=(7-c.getDay()+E)%7&&c.getDay()!==E;d++)f.value.push({day:d,month:c.getMonth(),year:c.getFullYear(),class:[]});typeof((s=t.data)==null?void 0:s.holiday)<"u"&&t.data.holiday.length!==0&&(t.data.holiday.preholidays.forEach(d=>{let _=d.split("-");const D=f.value.findIndex($=>$.year==_[0]&&$.month+1==_[1]&&$.day==_[2]);D!==-1&&(f.value[D].class[0]="preholiday")}),t.data.holiday.holidays.forEach(d=>{let _=d.split("-");const D=f.value.findIndex($=>$.year==_[0]&&$.month+1==_[1]&&$.day==_[2]);D!==-1&&(f.value[D].class[0]="weekend")}),t.data.holiday.holiday.forEach(d=>{let _=d.split("-");const D=f.value.findIndex($=>$.year==_[0]&&$.month+1==_[1]&&$.day==_[2]);D!==-1&&(f.value[D].class[0]="holiday")}),t.data.holiday.nowork.forEach(d=>{let _=d.split("-");const D=f.value.findIndex($=>$.year==_[0]&&$.month+1==_[1]&&$.day==_[2]);D!==-1&&(f.value[D].class[0]="nowork")}))},M=(g,c)=>{let s=g-c+1;for(let d=0;d<=g-c;d++)f.value[d+c].class[0]==="holiday"&&s--;return s},x=(g,c)=>{console.log(c);const s=N(new Date(g.year,g.month,g.day),"{dd}.{m}.{Y}");if(t.range==="range")if(console.log(i.value),u.value!==-1){if(u.value<=i.value)for(let d=u.value;d<=i.value;d++)f.value[d].class[1]="";else for(let d=i.value;d<=u.value;d++)f.value[d].class[1]="";i.value=c,u.value=-1,f.value[c].class[1]="active"}else if(i.value!==-1){if(u.value=c,u.value>=i.value)for(let _=i.value+1;_<c;_++)f.value[_].class[1]="select";else for(let _=c+1;_<i.value;_++)f.value[_].class[1]="select";f.value[c].class[1]="active";let d=N(new Date(f.value[i.value].year,f.value[i.value].month,f.value[i.value].day),"{dd}.{m}.{Y}");i.value>c?m("input",{dateStart:s,dateEnd:d,count:M(i.value,c)}):m("input",{dateStart:d,dateEnd:s,count:M(c,i.value)})}else i.value=c,f.value[c].class[1]="active";else i.value!==-1&&(f.value[i.value].class[1]=""),i.value=c,f.value[c].class[1]="active",m("input",{dateStart:s,count:1})};if(C(),typeof((L=t.data)==null?void 0:L.startDate)<"u"&&(i.value=f.value.findIndex(g=>g.day===l.value.getDate()&&g.month===r.value&&g.year===p.value),f.value[i.value].class[1]="active"),typeof((R=t.data)==null?void 0:R.endDate)<"u"&&t.range==="range"){u.value=f.value.findIndex(g=>g.day===n.value.getDate()&&g.month===w.value&&g.year===y.value),f.value[u.value].class[1]="active";for(let g=i.value+1;g<u.value;g++)f.value[g].class[1]="select"}const T=(g,c)=>{Ae(g,c)&&(f.value=[],k.value=0,l.value=new Date(g,c,1),p.value=l.value.getFullYear(),r.value=l.value.getMonth(),C())},Ae=(g,c)=>{if(!t.limitation)return!0;if(t.limitation[0].dateStart){console.log(t.limitation[0].dateStart);let s=t.limitation[0].dateStart.split(t.limitation[0].dateStart.match(/\D.*?\D?/));if(s[0].length>2&&s.reverse(),parseInt(s[2])>g||parseInt(s[2])===g&&parseInt(s[1])>c+1)return!1}if(t.limitation[t.limitation.length-1].dateEnd){console.log(t.limitation[t.limitation.length-1].dateEnd);let s=t.limitation[t.limitation.length-1].dateEnd.split(t.limitation[t.limitation.length-1].dateEnd.match(/\D.*?\D?/));if(s[0].length>2&&s.reverse(),parseInt(s[2])<g||parseInt(s[2])===g&&parseInt(s[1])<c+S)return!1}return!0};return(g,c)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",null,[e.createElementVNode("p",J,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[0]||(c[0]=e.withModifiers(s=>T(p.value-1,r.value),["prevent"]))},"«"),e.createElementVNode("button",{onClick:c[1]||(c[1]=e.withModifiers(s=>T(p.value,r.value-1),["prevent"]))},"‹")]),e.createElementVNode("span",K,[e.createElementVNode("button",null,e.toDisplayString(p.value),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(N)(l.value.setMonth(r.value),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[2]||(c[2]=e.withModifiers(s=>T(p.value,r.value+1),["prevent"]))},"›"),e.createElementVNode("button",{onClick:c[3]||(c[3]=e.withModifiers(s=>T(p.value+1,r.value),["prevent"]))},"»")])]),e.createElementVNode("div",Q,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(s,d)=>e.createElementVNode("button",{key:d,class:"disabled"},e.toDisplayString(e.unref(N)(new Date(1970,1,s+e.unref(E)),"{D}")),1)),64))]),e.createElementVNode("div",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(s,d)=>{var _,D;return e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[d<k.value+(7-new Date(p.value,r.value+1,1).getDay()+e.unref(E))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(s.month===r.value&&(!t.limitation||new Date(s.year,s.month,s.day+1).getTime()>new Date(b((_=t.limitation[0])==null?void 0:_.dateStart)).getTime()&&new Date(s.year,s.month,s.day).getTime()<new Date(b((D=t.limitation[0])==null?void 0:D.dateEnd)).getTime())?s.class:"disabled"),onClick:()=>{s.month===r.value&&x(s,d)}},e.toDisplayString(s.day),11,ee)):e.createCommentVNode("",!0)],64)}),128))])]),t.range==="range"?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("p",le,[e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[4]||(c[4]=s=>T(p.value-1,r.value))},"«"),e.createElementVNode("button",{onClick:c[5]||(c[5]=s=>T(p.value,r.value-1))},"‹")]),e.createElementVNode("span",oe,[e.createElementVNode("button",null,e.toDisplayString(new Date(p.value,r.value+1).getFullYear()),1),e.createElementVNode("button",null,e.toDisplayString(e.unref(N)(l.value.setMonth(r.value+1),"{F}")),1)]),e.createElementVNode("span",null,[e.createElementVNode("button",{onClick:c[6]||(c[6]=s=>T(p.value,r.value+1))},"›"),e.createElementVNode("button",{onClick:c[7]||(c[7]=s=>T(p.value+1,r.value))},"»")])]),e.createElementVNode("div",ne,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(7,(s,d)=>e.createElementVNode("button",{key:d,class:"disabled"},e.toDisplayString(e.unref(N)(new Date(1970,1,s+e.unref(E)),"{D}")),1)),64))]),e.createElementVNode("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(s,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[d>=k.value-(7+new Date(p.value,r.value+1,1).getDay()-e.unref(E))%7?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(s.month===h.value.getMonth()&&(!t.limitation||new Date(s.year,s.month,s.day+1).getTime()>new Date(b(t.limitation[0].dateStart)).getTime()&&new Date(s.year,s.month,s.day).getTime()<new Date(b(t.limitation[0].dateEnd)).getTime())?s.class:"disabled"),onClick:()=>{s.month===h.value.getMonth()&&x(s,d)}},e.toDisplayString(s.day),11,se)):e.createCommentVNode("",!0)],64))),128))])])):e.createCommentVNode("",!0)]))}}},Symbol.toStringTag,{value:"Module"})),ie=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwDropdown",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},trigger:{type:String,default:"click"},placement:{type:String,default:"bottom-left"},maxWidth:{type:Number,default:0},manual:{type:Boolean,default:!1}},setup(a){const o=a,l=e.ref(!1),n=e.ref(null),t=e.ref(null),m=e.ref({}),p=e.computed(()=>{let h=["sw-dropdown"];return o.size.length>0&&h.push("sw-"+o.size),o.type.length>0&&h.push("sw-"+o.type),h});e.watch(()=>o.manual,h=>{l.value=h,console.log("watch",l.value)});const w=async()=>{if(await e.nextTick(),!t.value)return;const h=window.pageYOffset||document.documentElement.scrollTop,i=window.pageXOffset||document.documentElement.scrollLeft;document.body.style.position="fixed",document.body.style.top=`-${h}px`,document.body.style.left=`-${i}px`,t.value.focus(),t.value.addEventListener("blur",()=>l.value=!1),document.body.style.position="",document.body.style.top="",document.body.style.left="",document.documentElement.scrollTop=h,document.documentElement.scrollLeft=i;const u=n.value.getBoundingClientRect(),B=t.value.offsetHeight,E=t.value.offsetWidth;console.log("popupHeight",B),console.log("popupWidth",E);let S=u.left+u.width/2+i,b=u.top+u.height/2+h;const[C,M]=o.placement.split("-",2);switch(console.log(o.placement),C){case"bottom":b=b+u.height/2+8;break;case"top":b=b-u.height/2-8-B;break;case"left":S=S-E-u.width/2-8,b=b-B/2;break;case"right":S=S+u.width/2+8,b=b-B/2;break}switch(M){case"left":S=S-u.width/2;break;case"right":S=S-E+u.width/2;break}S<0&&(S=0),b<0&&(b=0),m.value={position:"absolute",top:`${b}px`,left:`${S}px`,maxWidth:o.maxWidth===0?"":`${o.maxWidth}px`}},y=async()=>{o.trigger==="click"&&(l.value=!l.value),l.value&&await w()},r=async()=>{o.trigger==="hover"&&(l.value=!l.value),l.value&&await w()},f=async()=>{o.trigger==="context"&&(l.value=!l.value),l.value&&await w()},k=()=>{l.value&&w()};return e.onMounted(()=>window.addEventListener("resize",k)),e.onUnmounted(()=>window.removeEventListener("resize",k)),(h,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(p.value),onClick:i[0]||(i[0]=e.withModifiers(u=>y(),["stop"])),onMouseover:i[1]||(i[1]=e.withModifiers(u=>r(),["stop"])),onMouseleave:i[2]||(i[2]=e.withModifiers(u=>r(),["stop"])),onContextmenu:i[3]||(i[3]=e.withModifiers(u=>f(),["stop"])),ref_key:"dropdownRef",ref:n},[e.renderSlot(h.$slots,"default"),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("ul",{key:0,ref_key:"popupRef",ref:t,class:e.normalizeClass(["sw-dropdown-popup",o.class]),style:e.normalizeStyle(m.value),tabindex:"-1"},[e.renderSlot(h.$slots,"dropdown")],6)):e.createCommentVNode("",!0)]))],34))}}},Symbol.toStringTag,{value:"Module"})),ce=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwDropdownItem",props:{class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:""},iconBefore:{type:String,default:""}},setup(a){const o=a,l=e.computed(()=>{let n=["sw-dropdown-item"];return o.size.length>0&&n.push("sw-"+o.size),o.type.length>0&&n.push("sw-"+o.type),o.class.length>0&&n.push(o.class),n});return(n,t)=>{const m=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(l.value)},[e.createVNode(m,{"icon-class":a.iconBefore},null,8,["icon-class"]),e.renderSlot(n.$slots,"default")],2)}}}},Symbol.toStringTag,{value:"Module"})),de=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwFormItem",props:{class:{type:String,default:""},type:{type:String,default:""}},setup(a){const o=a,l=e.computed(()=>{let n=["sw-form-item"];return o.type.length>0&&n.push("sw-"+o.type),o.class.length>0&&n.push(o.class),n});return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value)},[e.renderSlot(n.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),pe=(a,o)=>{const l=a.__vccOpts||a;for(const[n,t]of o)l[n]=t;return l},me={name:"SvgIcon",props:{prefix:{type:String,default:"icon"},iconClass:{type:String,required:!0},className:{type:String,default:""}},computed:{isExt(){return G(this.iconClass)}}},fe=["href"];function ue(a,o,l,n,t,m){return m.isExt?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0,style:"mask: url("+l.iconClass+") no-repeat 50% 50%;",class:"svg-external-icon svg-icon"},a.$attrs),null,16)):(e.openBlock(),e.createElementBlock("svg",e.mergeProps({key:1,class:"svg-icon "+l.className,"aria-hidden":"true"},a.$attrs),[e.createElementVNode("use",{href:"#"+l.prefix+"-"+l.iconClass},null,8,fe)],16))}const P=pe(me,[["render",ue]]),ge=["for"],he={key:0,title:"Это поле обязательно для заполнения."},ye=["required","placeholder","type","id","name"],_e=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwInput",props:e.mergeModels({before:{type:String,default:""},after:{type:String,default:""},placeholder:{type:String,default:""},label:{type:String,default:""},name:{type:String,required:!0},class:{type:String,default:""},size:{type:String,default:""},type:{type:String,default:"text"},required:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["suffix","prefix"],["update:modelValue"]),setup(a,{emit:o}){var h;const l=e.useModel(a,"modelValue"),n=a,t=e.ref(null),m=o,p=i=>{i.target.setSelectionRange(l.value.length,l.value.length),t.value!==null&&(t.value.style.top="-.6em")},w=i=>{var u;((u=l.value)==null?void 0:u.length)===0&&t.value!==null&&t.value.removeAttribute("style")};((h=l.value)==null?void 0:h.length)>0&&t.value!==null&&(t.value.style.top="-.6em");const y=()=>{m("suffix")},r=()=>{m("prefix")},f=e.computed(()=>{let i=["sw-input"];return n.size.length>0&&i.push("sw-"+n.size),n.class.length>0&&i.push(n.class),i});e.watch(l,(i,u)=>{n.type==="phone"&&(l.value=k(i,u))});const k=(i,u)=>{if(/^\+[0-9]\s/.test(u)&&i.length===2||/^\+0\s/.test(i))return"";const B=i;if(typeof B>"u"||B.length===0)return B;const E="+0 (___) ___-__-__";let S=0;const b=E.replace(/\D/g,""),C=B.replace(/\D/g,"");let M=E.replace(/[_\d]/g,T=>S<C.length?C.charAt(S++)||b.charAt(S):T);S=M.indexOf("_"),S!==-1&&(S=S<5?3:S,M=M.slice(0,S));let x=E.slice(0,B.length).replace(/_+/g,T=>`\\d{1,${T.length}}`).replace(/[+()]/g,"\\$&");if(x=new RegExp(`^${x}$`),M=M.replace(/[-—]$|(\) )$/g,""),!x.test(B)||B.length<5)return M};return(i,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(f.value)},[n.before.length>0?(e.openBlock(),e.createBlock(P,{key:0,"icon-class":n.before,onClick:r},null,8,["icon-class"])):e.renderSlot(i.$slots,"prefix",{key:1}),n.label.length>0?(e.openBlock(),e.createElementBlock("label",{key:2,for:n.name,ref_key:"lab",ref:t},[e.createTextVNode(e.toDisplayString(n.label),1),n.required?(e.openBlock(),e.createElementBlock("span",he,"*")):e.createCommentVNode("",!0)],8,ge)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":u[0]||(u[0]=B=>l.value=B),required:n.required,placeholder:n.required&&n.label.length===0?n.placeholder+"*":n.placeholder,type:n.type,id:n.name,name:n.name,size:"60",onFocus:p,onBlur:w,maxlength:"128"},null,40,ye),[[e.vModelDynamic,l.value]]),n.after.length>0?(e.openBlock(),e.createBlock(P,{key:3,"icon-class":n.after,onClick:y},null,8,["icon-class"])):e.renderSlot(i.$slots,"suffix",{key:4})],2))}}},Symbol.toStringTag,{value:"Module"})),Se={key:0},we=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwMessage",props:e.mergeModels({name:{type:String,default:""},class:{type:String,default:""},iconAfter:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=e.useModel(a,"modelValue"),l=a,n=e.ref(null);return(t,m)=>{const p=e.resolveComponent("svg-icon");return o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sw-message",l.class]),ref_key:"messageRef",ref:n},[l.name.length>0?(e.openBlock(),e.createElementBlock("header",Se,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(l.name)+" ",1),e.createVNode(j,{link:"",type:"primary",onClick:m[0]||(m[0]=w=>o.value=!1)},{default:e.withCtx(()=>[e.createVNode(p,{"icon-class":l.iconAfter},null,8,["icon-class"])]),_:1})])])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"default",{},()=>[m[1]||(m[1]=e.createTextVNode("111222"))]),e.createElementVNode("footer",null,[e.renderSlot(t.$slots,"footer")])],2)):e.createCommentVNode("",!0)}}}},Symbol.toStringTag,{value:"Module"})),be=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSection",props:{name:{type:String,default:""},class:{type:String,default:""},iconAfter:{type:String,default:""}},setup(a){const o=a;return(l,n)=>{const t=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(o.class)},[e.createElementVNode("header",null,[e.renderSlot(l.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(o.name)+" ",1),e.createVNode(t,{"icon-class":o.iconAfter},null,8,["icon-class"])])]),e.renderSlot(l.$slots,"default"),e.createElementVNode("footer",null,[e.renderSlot(l.$slots,"footer")])],2)}}}},Symbol.toStringTag,{value:"Module"})),ke={class:"popup"},Be={class:"wrapper"},Ee={class:"scrollbar"},$e=["onClick"],De=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSelect",props:e.mergeModels({name:{type:String,default:""},class:{type:String,default:""},placeholder:{type:String,default:""},token:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=e.ref({fullText:""}),l=e.ref(!1),n=e.ref([]),t=e.useModel(a,"modelValue"),m=a;e.watch(t.text,y=>{y.length>3&&(o.value.fullText=y)}),e.watch(o.value.fullText,(y,r)=>{l.value=y.length>3&&y.length>r.length,y.length>3&&p()});const p=()=>{let y="https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address";console.log(o.value.fullText),axios.post(y,{query:o.value.fullText},{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Token "+m.token}}).then(r=>{console.log(r.data.suggestions),n.value=r.data.suggestions,n.value.length===1&&w(n.value[0])}).catch(r=>{console.log(r)})},w=y=>{o.value.fullText=y.value,l.value=!1;const r={};r.text=y.value,r.coords=[Number(y.data.geo_lat),Number(y.data.geo_lon)],r.suggestion=y.data,t.value=r};return(y,r)=>{const f=e.resolveComponent("sw-input");return e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(f,{size:"large",modelValue:o.value.fullText,"onUpdate:modelValue":r[0]||(r[0]=k=>o.value.fullText=k),placeholder:a.placeholder},null,8,["modelValue","placeholder"]),e.withDirectives(e.createElementVNode("div",Be,[e.createElementVNode("ul",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(k,h)=>(e.openBlock(),e.createElementBlock("li",{tabindex:"1",key:h,onClick:i=>w(k)},e.toDisplayString(k.value),9,$e))),128))])],512),[[e.vShow,l.value]])])}}}},Symbol.toStringTag,{value:"Module"})),Te={key:0},O={__name:"SwSkeletonItem",props:{width:{type:String,default:"100"},class:{type:String,default:""},animate:{type:Boolean,default:!1},size:{type:String,default:""}},setup(a){const o=a,l=e.computed(()=>{let t=["sw-skeleton-item"];return o.size.length>0&&t.push("sw-"+o.size),o.animate&&t.push("sw-animate"),o.class.length>0&&t.push(o.class),t}),n=e.computed(()=>({width:o.width+"%"}));return(t,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value),style:e.normalizeStyle(n.value)},[o.animate?(e.openBlock(),e.createElementBlock("div",Te)):e.createCommentVNode("",!0)],6))}},Me=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"})),Ve=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSkeleton",props:{class:{type:String,default:""},visual:{type:Boolean,default:!1}},setup(a){const o=a;return(l,n)=>o.visual?e.renderSlot(l.$slots,"default",{key:0},()=>[n[0]||(n[0]=e.createTextVNode("1"))]):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["sw-skeleton",o.class])},[e.renderSlot(l.$slots,"skeleton",{},()=>[e.createVNode(O,{animate:"",size:"small"})])],2))}}},Symbol.toStringTag,{value:"Module"})),Ce=["name","id"],Ne=["for","data-onlabel","data-offlabel"],xe=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSwitch",props:e.mergeModels({id:{type:String,default:"checkbox"},class:{type:String,default:""},name:{type:String,default:""},on:{type:String,default:""},off:{type:String,default:""},size:{type:String,default:""},checkbox:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const o=e.useModel(a,"modelValue"),l=a,n=e.computed(()=>{let t=["sw-switch"];return l.size.length>0&&t.push("sw-"+l.size),l.checkbox&&t.push("sw-checkbox"),l.class.length>0&&t.push(l.class),t});return(t,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(n.value)},[e.withDirectives(e.createElementVNode("input",{type:"checkbox",name:l.name,class:"sw-control",id:l.id,"onUpdate:modelValue":m[0]||(m[0]=p=>o.value=p)},null,8,Ce),[[e.vModelCheckbox,o.value]]),e.createElementVNode("label",{for:l.id,class:"sw-label","data-onlabel":l.on,"data-offlabel":l.off},null,8,Ne),e.renderSlot(t.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),ze=["onClick"],ve=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabs",props:e.mergeModels({name:{type:String},class:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["tab-click"],["update:modelValue"]),setup(a,{emit:o}){e.ref(0);const l=e.ref([]),n=a,t=e.useModel(a,"modelValue"),m=o;return l.value=e.useSlots().default().filter(p=>p.type.__name==="SwTabsPane"),e.provide("activeTab",t),e.provide("tabs",l),(p,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("sw-tabs "+n.class)},[e.createElementVNode("header",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(y,r)=>(e.openBlock(),e.createElementBlock("span",{key:r,class:e.normalizeClass([{active:t.value===r}]),onClick:f=>{t.value=r,m("tab-click",r)}},e.toDisplayString(y.props.label||y.props.title),11,ze))),128))]),e.renderSlot(p.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),je=["onClick"],Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsNew",props:e.mergeModels({name:{type:String},class:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["tab-click"],["update:modelValue"]),setup(a,{emit:o}){e.ref(0);const l=e.ref([]),n=a,t=e.useModel(a,"modelValue"),m=o;return e.provide("activeTab",t),e.provide("tabs",l),e.provide("registerTab",p=>{l.value.push(p)}),(p,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("sw-tabs "+n.class)},[e.createElementVNode("header",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(y,r)=>(e.openBlock(),e.createElementBlock("span",{key:r,class:e.normalizeClass([{active:t.value===r}]),onClick:f=>{t.value=r,m("tab-click",r)}},e.toDisplayString(y.props.label||y.props.title),11,je))),128))]),e.renderSlot(p.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),Oe={key:0,class:"tab-content"},Ie=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsPane",props:{title:{type:String,required:!0}},setup(a){const o=a,l=e.inject("activeTab"),n=e.inject("tabs"),t=e.computed(()=>{const m=n.value.findIndex(p=>p.props.title===o.title);return l.value===m});return(m,p)=>t.value?(e.openBlock(),e.createElementBlock("div",Oe,[e.renderSlot(m.$slots,"default")])):e.createCommentVNode("",!0)}}},Symbol.toStringTag,{value:"Module"})),Fe={key:0,class:"tab-content"},Ye=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsPaneNew",props:{label:{type:String,required:!0},title:{type:String}},setup(a){const o=a,l=e.inject("registerTab");if(!l)throw new Error("SwTabsPane must be used inside SwTabs");l({props:o});const n=e.inject("activeTab");if(!e.inject("tabs"))throw new Error("Tabs array is not provided by SwTabs");const m=e.inject("tabs").value.length-1;return(p,w)=>e.unref(n)===m?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(p.$slots,"default")])):e.createCommentVNode("",!0)}}},Symbol.toStringTag,{value:"Module"}));V.components=z,V.default=q,Object.defineProperties(V,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineAsyncComponent as m } from "vue";
|
|
2
|
-
const n = /* @__PURE__ */ Object.assign({ "./components/SwAlert.vue": () => import("./SwAlert-
|
|
2
|
+
const n = /* @__PURE__ */ Object.assign({ "./components/SwAlert.vue": () => import("./SwAlert-DVw7d7ww.js"), "./components/SwButton.vue": () => import("./SwButton-0uPLNlAn.js"), "./components/SwCollapse.vue": () => import("./SwCollapse-DxAVOWF1.js"), "./components/SwDataPicker.vue": () => import("./SwDataPicker-CA87wvQJ.js"), "./components/SwDropdown.vue": () => import("./SwDropdown-oRNlcfUs.js"), "./components/SwDropdownItem.vue": () => import("./SwDropdownItem-C3_wJ1DL.js"), "./components/SwFormItem.vue": () => import("./SwFormItem-CfnEis1u.js"), "./components/SwInput.vue": () => import("./SwInput-CFpMTggn.js"), "./components/SwMessage.vue": () => import("./SwMessage-BB2yKYsR.js"), "./components/SwSection.vue": () => import("./SwSection-CaY8OFmf.js"), "./components/SwSelect.vue": () => import("./SwSelect-0vcmQ8qv.js"), "./components/SwSkeleton.vue": () => import("./SwSkeleton-DWILNFfF.js"), "./components/SwSkeletonItem.vue": () => import("./SwSkeletonItem-CU7LvihY.js"), "./components/SwSwitch.vue": () => import("./SwSwitch-BxSLWRTx.js"), "./components/SwTabs.vue": () => import("./SwTabs-DgvDpw7u.js"), "./components/SwTabsNew.vue": () => import("./SwTabsNew-Dr5Vyz6M.js"), "./components/SwTabsPane.vue": () => import("./SwTabsPane-BUUmFjh7.js"), "./components/SwTabsPaneNew.vue": () => import("./SwTabsPaneNew-DFPu-sRT.js") }), t = {};
|
|
3
3
|
for (const e in n) {
|
|
4
4
|
const o = e.split("/").pop().replace(".vue", "").replace(/-(\w)/g, (s, p) => p.toUpperCase());
|
|
5
5
|
t[o] = m(() => n[e]());
|
package/package.json
CHANGED
package/dist/SwAlert-C-wawirc.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ref as f, onMounted as m, onUnmounted as y, computed as g, resolveComponent as h, createBlock as o, openBlock as l, Teleport as v, createVNode as w, Transition as S, withCtx as k, createElementBlock as _, createCommentVNode as b, normalizeClass as C, renderSlot as n, createTextVNode as N, toDisplayString as $ } from "vue";
|
|
2
|
-
const x = {
|
|
3
|
-
__name: "SwAlert",
|
|
4
|
-
props: {
|
|
5
|
-
message: { type: String, default: "Default message" },
|
|
6
|
-
before: { type: String, default: "" },
|
|
7
|
-
class: { type: String, default: "" },
|
|
8
|
-
// Стили
|
|
9
|
-
after: { type: String, default: "" },
|
|
10
|
-
size: { type: String, default: "" },
|
|
11
|
-
// размер small, large
|
|
12
|
-
duration: { type: Number, default: 6e3 },
|
|
13
|
-
// Время отображения в миллисекундах
|
|
14
|
-
type: { type: String, default: "info" }
|
|
15
|
-
// тип по умолчанию - info | success| warning | error
|
|
16
|
-
},
|
|
17
|
-
emits: ["close"],
|
|
18
|
-
setup(c, { emit: u }) {
|
|
19
|
-
const e = c, p = u, a = f(!0), r = () => {
|
|
20
|
-
p("close"), a.value = !1;
|
|
21
|
-
};
|
|
22
|
-
m(() => {
|
|
23
|
-
setTimeout(() => {
|
|
24
|
-
r();
|
|
25
|
-
}, e.duration);
|
|
26
|
-
}), y(() => {
|
|
27
|
-
});
|
|
28
|
-
const d = g(() => {
|
|
29
|
-
const t = ["sw-alert"];
|
|
30
|
-
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;
|
|
31
|
-
});
|
|
32
|
-
let s = document.querySelector("div.sw-wrapper-alert");
|
|
33
|
-
return s === null && (s = document.createElement("div"), s.className = "wrapper-alert", document.body.appendChild(s)), (t, z) => {
|
|
34
|
-
const i = h("svg-icon");
|
|
35
|
-
return l(), o(v, { to: "div.sw-wrapper-alert" }, [
|
|
36
|
-
w(S, { name: "fade" }, {
|
|
37
|
-
default: k(() => [
|
|
38
|
-
a.value ? (l(), _("div", {
|
|
39
|
-
key: 0,
|
|
40
|
-
class: C(d.value)
|
|
41
|
-
}, [
|
|
42
|
-
e.before.length > 0 ? (l(), o(i, {
|
|
43
|
-
key: 0,
|
|
44
|
-
"icon-class": e.before
|
|
45
|
-
}, null, 8, ["icon-class"])) : n(t.$slots, "prefix", { key: 1 }),
|
|
46
|
-
n(t.$slots, "default", {}, () => [
|
|
47
|
-
N($(e.message), 1)
|
|
48
|
-
]),
|
|
49
|
-
e.after.length > 0 ? (l(), o(i, {
|
|
50
|
-
key: 2,
|
|
51
|
-
"icon-class": e.after,
|
|
52
|
-
onClick: r
|
|
53
|
-
}, null, 8, ["icon-class"])) : n(t.$slots, "suffix", { key: 3 })
|
|
54
|
-
], 2)) : b("", !0)
|
|
55
|
-
]),
|
|
56
|
-
_: 3
|
|
57
|
-
})
|
|
58
|
-
]);
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
export {
|
|
63
|
-
x as default
|
|
64
|
-
};
|