@studio-west/component-sw 0.11.13 → 0.11.14
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/{SwDatePicker-BVVouucy.js → SwDatePicker-ClrgmXLB.js} +1 -1
- package/dist/{SwDropdownItem-C1-FnGEY.js → SwDropdownItem-C9DLF3t9.js} +1 -1
- package/dist/{SwGide-CgNyNocW.js → SwGide-DZ-4tphT.js} +1 -1
- package/dist/{SwInput-BkN2M-SL.js → SwInput-FZN0vQfA.js} +1 -1
- package/dist/{SwMessage-Bkt1orr8.js → SwMessage-ensOSmFe.js} +1 -1
- package/dist/{SwSlider-o3z_9DLW.js → SwSlider-NnhLuopp.js} +1 -1
- package/dist/{SwTable-BKZ5idCi.js → SwTable-0bcoGH2E.js} +45 -45
- package/dist/{index-urBWY4_1.js → index-DRldEBoo.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -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-DRldEBoo.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-DRldEBoo.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
3
|
import { _ as f } from "./SwButton.vue_vue_type_script_setup_true_lang-aODPwFa6.js";
|
|
4
|
-
import { _ as h } from "./index-
|
|
4
|
+
import { _ as h } from "./index-DRldEBoo.js";
|
|
5
5
|
const B = ["src"], q = {
|
|
6
6
|
__name: "SwGide",
|
|
7
7
|
props: /* @__PURE__ */ E({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as k, mergeModels as i, useModel as _, ref as z, computed as V, watch as q, createElementBlock as u, openBlock as n, normalizeClass as B, createBlock as f, renderSlot as c, createCommentVNode as d, withDirectives as S, createTextVNode as C, toDisplayString as M, createElementVNode as w, mergeProps as N, vModelDynamic as $ } from "vue";
|
|
2
|
-
import { f as D, _ as m } from "./index-
|
|
2
|
+
import { f as D, _ as m } from "./index-DRldEBoo.js";
|
|
3
3
|
const I = ["for"], E = {
|
|
4
4
|
key: 0,
|
|
5
5
|
title: "Это поле обязательно для заполнения."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
import { _ as M } from "./SwButton.vue_vue_type_script_setup_true_lang-aODPwFa6.js";
|
|
3
|
-
import { _ as N } from "./index-
|
|
3
|
+
import { _ as N } from "./index-DRldEBoo.js";
|
|
4
4
|
const R = { key: 0 }, x = {
|
|
5
5
|
__name: "SwMessage",
|
|
6
6
|
props: /* @__PURE__ */ f({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mergeModels as F, useModel as I, ref as p, computed as v, onMounted as q, onUnmounted as U, createElementBlock as M, openBlock as x, normalizeClass as D, createElementVNode as N, withModifiers as P, normalizeStyle as B, Fragment as j, renderList as G, renderSlot as H, createCommentVNode as J, toDisplayString as K } from "vue";
|
|
2
|
-
import { c as O } from "./index-
|
|
2
|
+
import { c as O } from "./index-DRldEBoo.js";
|
|
3
3
|
const Q = ["onMouseenter", "onMouseleave", "onFocus", "onBlur", "onMousedown", "onTouchstart"], _ = {
|
|
4
4
|
__name: "SwSlider",
|
|
5
5
|
props: /* @__PURE__ */ F({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useSlots as F, ref as W, onMounted as G, computed as
|
|
1
|
+
import { useSlots as F, ref as W, onMounted as G, computed as w, createElementBlock as c, openBlock as u, createElementVNode as C, Fragment as y, renderList as g, normalizeStyle as R, toDisplayString as M, renderSlot as J, createTextVNode as K } from "vue";
|
|
2
2
|
import O from "./SwTableColumn-BLF5bPuJ.js";
|
|
3
3
|
const P = { class: "sw-table" }, Q = ["colspan", "rowspan"], U = ["colspan", "rowspan"], Z = {
|
|
4
4
|
__name: "SwTable",
|
|
@@ -8,9 +8,9 @@ const P = { class: "sw-table" }, Q = ["colspan", "rowspan"], U = ["colspan", "ro
|
|
|
8
8
|
required: !0
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
function
|
|
11
|
+
setup(x) {
|
|
12
|
+
const _ = x, E = F(), h = W([]);
|
|
13
|
+
function k(r) {
|
|
14
14
|
const n = [];
|
|
15
15
|
for (const t of r)
|
|
16
16
|
if (t.type === O) {
|
|
@@ -18,41 +18,41 @@ const P = { class: "sw-table" }, Q = ["colspan", "rowspan"], U = ["colspan", "ro
|
|
|
18
18
|
...t.props,
|
|
19
19
|
children: []
|
|
20
20
|
}, e = t.children?.default?.();
|
|
21
|
-
e && e.length > 0 && (o.children =
|
|
21
|
+
e && e.length > 0 && (o.children = k(e)), n.push(o);
|
|
22
22
|
}
|
|
23
23
|
return n;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function $(r) {
|
|
26
26
|
if (!r || r.length === 0) return 1;
|
|
27
27
|
let n = 1;
|
|
28
28
|
for (const t of r)
|
|
29
29
|
if (t.children && t.children.length > 0) {
|
|
30
|
-
const o =
|
|
30
|
+
const o = $(t.children);
|
|
31
31
|
n = Math.max(n, 1 + o);
|
|
32
32
|
}
|
|
33
33
|
return n;
|
|
34
34
|
}
|
|
35
35
|
function V(r, n) {
|
|
36
36
|
const t = Array.from({ length: n }, () => []);
|
|
37
|
-
function o(e,
|
|
37
|
+
function o(e, i, p = "") {
|
|
38
38
|
for (let a = 0; a < e.length; a++) {
|
|
39
|
-
const l = e[a],
|
|
39
|
+
const l = e[a], d = p ? `${p}-${l.prop || a}` : l.prop || a;
|
|
40
40
|
if (l.children && l.children.length > 0) {
|
|
41
41
|
const s = B(l.children);
|
|
42
|
-
t[
|
|
43
|
-
key:
|
|
42
|
+
t[i].push({
|
|
43
|
+
key: d,
|
|
44
44
|
label: l.label,
|
|
45
45
|
colspan: s,
|
|
46
46
|
rowspan: 1,
|
|
47
47
|
width: l.width,
|
|
48
48
|
height: l.height
|
|
49
|
-
}), o(l.children,
|
|
49
|
+
}), o(l.children, i + 1, d);
|
|
50
50
|
} else
|
|
51
|
-
t[
|
|
51
|
+
t[i].push({
|
|
52
52
|
key: l.prop,
|
|
53
53
|
label: l.label,
|
|
54
54
|
colspan: 1,
|
|
55
|
-
rowspan: n -
|
|
55
|
+
rowspan: n - i,
|
|
56
56
|
width: l.width,
|
|
57
57
|
height: l.height,
|
|
58
58
|
prop: l.prop
|
|
@@ -79,64 +79,64 @@ const P = { class: "sw-table" }, Q = ["colspan", "rowspan"], U = ["colspan", "ro
|
|
|
79
79
|
}
|
|
80
80
|
function N(r, n) {
|
|
81
81
|
const t = [], o = /* @__PURE__ */ new Map();
|
|
82
|
-
return r.forEach((e,
|
|
83
|
-
const
|
|
82
|
+
return r.forEach((e, i) => {
|
|
83
|
+
const p = [];
|
|
84
84
|
n.forEach((a, l) => {
|
|
85
|
-
const
|
|
86
|
-
if (o.has(
|
|
85
|
+
const d = `${i}-${a.prop}`;
|
|
86
|
+
if (o.has(d))
|
|
87
87
|
return;
|
|
88
88
|
const s = e[a.prop];
|
|
89
|
-
let
|
|
90
|
-
s && typeof s == "object" && s !== null && (
|
|
89
|
+
let D = s, b = 1, v = 1, T = {};
|
|
90
|
+
s && typeof s == "object" && s !== null && (D = s.label || s.value || "", b = s.colspan || 1, v = s.rowspan || 1, T = s.style || {});
|
|
91
91
|
const z = {
|
|
92
|
-
key:
|
|
93
|
-
label:
|
|
92
|
+
key: d,
|
|
93
|
+
label: D,
|
|
94
94
|
prop: a.prop,
|
|
95
95
|
colspan: b,
|
|
96
|
-
rowspan:
|
|
97
|
-
style:
|
|
96
|
+
rowspan: v,
|
|
97
|
+
style: T,
|
|
98
98
|
originalRow: e,
|
|
99
|
-
rowIndex:
|
|
99
|
+
rowIndex: i
|
|
100
100
|
};
|
|
101
|
-
|
|
102
|
-
for (let f = 0; f <
|
|
103
|
-
for (let
|
|
104
|
-
if (f === 0 &&
|
|
105
|
-
const
|
|
106
|
-
|
|
101
|
+
p.push(z);
|
|
102
|
+
for (let f = 0; f < v; f++)
|
|
103
|
+
for (let m = 0; m < b; m++) {
|
|
104
|
+
if (f === 0 && m === 0) continue;
|
|
105
|
+
const S = `${i + f}-${n[l + m]?.prop}`;
|
|
106
|
+
S && o.set(S, !0);
|
|
107
107
|
}
|
|
108
|
-
}),
|
|
108
|
+
}), p.length > 0 && t.push(p);
|
|
109
109
|
}), t;
|
|
110
110
|
}
|
|
111
111
|
G(() => {
|
|
112
112
|
const r = E.default?.() || [];
|
|
113
|
-
|
|
113
|
+
h.value = k(r), console.log("SwTable mounted - columnTree:", h.value), console.log("SwTable mounted - data:", _.data);
|
|
114
114
|
});
|
|
115
|
-
const A =
|
|
116
|
-
return (r, n) => (
|
|
117
|
-
|
|
118
|
-
(
|
|
119
|
-
(
|
|
115
|
+
const A = w(() => $(h.value)), H = w(() => V(h.value, A.value)), j = w(() => L(h.value)), q = w(() => N(_.data, j.value));
|
|
116
|
+
return (r, n) => (u(), c("table", P, [
|
|
117
|
+
C("thead", null, [
|
|
118
|
+
(u(!0), c(y, null, g(H.value, (t, o) => (u(), c("tr", { key: o }, [
|
|
119
|
+
(u(!0), c(y, null, g(t, (e) => (u(), c("th", {
|
|
120
120
|
key: e.key,
|
|
121
121
|
colspan: e.colspan,
|
|
122
122
|
rowspan: e.rowspan,
|
|
123
|
-
style:
|
|
124
|
-
},
|
|
123
|
+
style: R({ minWidth: e.width, minHeight: e.height })
|
|
124
|
+
}, M(e.label), 13, Q))), 128))
|
|
125
125
|
]))), 128))
|
|
126
126
|
]),
|
|
127
|
-
|
|
128
|
-
(
|
|
129
|
-
(
|
|
127
|
+
C("tbody", null, [
|
|
128
|
+
(u(!0), c(y, null, g(q.value, (t, o) => (u(), c("tr", { key: o }, [
|
|
129
|
+
(u(!0), c(y, null, g(t, (e) => (u(), c("td", {
|
|
130
130
|
key: e.key,
|
|
131
131
|
colspan: e.colspan,
|
|
132
132
|
rowspan: e.rowspan,
|
|
133
|
-
style:
|
|
133
|
+
style: R(e.style)
|
|
134
134
|
}, [
|
|
135
135
|
J(r.$slots, e.prop, {
|
|
136
136
|
row: e.originalRow,
|
|
137
137
|
$index: e.rowIndex
|
|
138
138
|
}, () => [
|
|
139
|
-
K(
|
|
139
|
+
K(M(e.label), 1)
|
|
140
140
|
])
|
|
141
141
|
], 12, U))), 128))
|
|
142
142
|
]))), 128))
|
|
@@ -164,7 +164,7 @@ function v(e = {}) {
|
|
|
164
164
|
}), i = s.mount(document.createElement("div"));
|
|
165
165
|
p && i.$el && p.appendChild(i.$el);
|
|
166
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-
|
|
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-ClrgmXLB.js"), "./components/SwDropdown.vue": () => import("./SwDropdown-DQGTnnKw.js"), "./components/SwDropdownItem.vue": () => import("./SwDropdownItem-C9DLF3t9.js"), "./components/SwDropdownNew.vue": () => import("./SwDropdownNew-CYfjZFd2.js"), "./components/SwFormItem.vue": () => import("./SwFormItem-CaA4jsoa.js"), "./components/SwGide.vue": () => import("./SwGide-DZ-4tphT.js"), "./components/SwIcon.vue": () => Promise.resolve().then(() => R), "./components/SwInput.vue": () => import("./SwInput-FZN0vQfA.js"), "./components/SwMessage.vue": () => import("./SwMessage-ensOSmFe.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-NnhLuopp.js"), "./components/SwSwitch.vue": () => import("./SwSwitch-DeMdyD0-.js"), "./components/SwTable.vue": () => import("./SwTable-0bcoGH2E.js"), "./components/SwTableColumn.vue": () => import("./SwTableColumn-BLF5bPuJ.js"), "./components/SwTabs.vue": () => import("./SwTabs-DkSI4oAh.js"), "./components/SwTabsPane.vue": () => import("./SwTabsPane-Dwtj8g7T.js") }), S = {};
|
|
168
168
|
for (const e in _) {
|
|
169
169
|
const n = e.split("/").pop().replace(".vue", "").replace(/-(\w)/g, (o, t) => t.toUpperCase());
|
|
170
170
|
S[n] = B(() => _[e]());
|
package/dist/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...o){const r=new this(n);return o.forEach(s=>r.set(s)),r}static accessor(n){const r=(this[nt]=this[nt]={accessors:{}}).accessors,s=this.prototype;function l(a){const i=ce(a);r[i]||(Co(s,a),r[i]=!0)}return u.isArray(n)?n.forEach(l):l(n),this}};U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(U.prototype,({value:t},n)=>{let o=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(r){this[o]=r}}}),u.freezeMethods(U);function De(t,n){const o=this||ie,r=n||o,s=U.from(r.headers);let l=r.data;return u.forEach(t,function(i){l=i.call(o,l,s.normalize(),n?n.status:void 0)}),s.normalize(),l}function ot(t){return!!(t&&t.__CANCEL__)}let de=class extends x{constructor(n,o,r){super(n??"canceled",x.ERR_CANCELED,o,r),this.name="CanceledError",this.__CANCEL__=!0}};function rt(t,n,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?t(o):n(new x("Request failed with status code "+o.status,[x.ERR_BAD_REQUEST,x.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function xo(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function Oo(t,n){t=t||10;const o=new Array(t),r=new Array(t);let s=0,l=0,a;return n=n!==void 0?n:1e3,function(c){const p=Date.now(),m=r[l];a||(a=p),o[s]=c,r[s]=p;let b=l,B=0;for(;b!==s;)B+=o[b++],b=b%t;if(s=(s+1)%t,s===l&&(l=(l+1)%t),p-a<n)return;const C=m&&p-m;return C?Math.round(B*1e3/C):void 0}}function No(t,n){let o=0,r=1e3/n,s,l;const a=(p,m=Date.now())=>{o=m,s=null,l&&(clearTimeout(l),l=null),t(...p)};return[(...p)=>{const m=Date.now(),b=m-o;b>=r?a(p,m):(s=p,l||(l=setTimeout(()=>{l=null,a(s)},r-b)))},()=>s&&a(s)]}const ye=(t,n,o=3)=>{let r=0;const s=Oo(50,250);return No(l=>{const a=l.loaded,i=l.lengthComputable?l.total:void 0,c=a-r,p=s(c),m=a<=i;r=a;const b={loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:p||void 0,estimated:p&&i&&m?(i-a)/p:void 0,event:l,lengthComputable:i!=null,[n?"download":"upload"]:!0};t(b)},o)},st=(t,n)=>{const o=t!=null;return[r=>n[0]({lengthComputable:o,total:t,loaded:r}),n[1]]},lt=t=>(...n)=>u.asap(()=>t(...n)),$o=z.hasStandardBrowserEnv?((t,n)=>o=>(o=new URL(o,z.origin),t.protocol===o.protocol&&t.host===o.host&&(n||t.port===o.port)))(new URL(z.origin),z.navigator&&/(msie|trident)/i.test(z.navigator.userAgent)):()=>!0,Do=z.hasStandardBrowserEnv?{write(t,n,o,r,s,l,a){if(typeof document>"u")return;const i=[`${t}=${encodeURIComponent(n)}`];u.isNumber(o)&&i.push(`expires=${new Date(o).toUTCString()}`),u.isString(r)&&i.push(`path=${r}`),u.isString(s)&&i.push(`domain=${s}`),l===!0&&i.push("secure"),u.isString(a)&&i.push(`SameSite=${a}`),document.cookie=i.join("; ")},read(t){if(typeof document>"u")return null;const n=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Mo(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ao(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function at(t,n,o){let r=!Mo(n);return t&&(r||o==!1)?Ao(t,n):n}const it=t=>t instanceof U?{...t}:t;function Z(t,n){n=n||{};const o={};function r(p,m,b,B){return u.isPlainObject(p)&&u.isPlainObject(m)?u.merge.call({caseless:B},p,m):u.isPlainObject(m)?u.merge({},m):u.isArray(m)?m.slice():m}function s(p,m,b,B){if(u.isUndefined(m)){if(!u.isUndefined(p))return r(void 0,p,b,B)}else return r(p,m,b,B)}function l(p,m){if(!u.isUndefined(m))return r(void 0,m)}function a(p,m){if(u.isUndefined(m)){if(!u.isUndefined(p))return r(void 0,p)}else return r(void 0,m)}function i(p,m,b){if(b in n)return r(p,m);if(b in t)return r(void 0,p)}const c={url:l,method:l,data:l,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(p,m,b)=>s(it(p),it(m),b,!0)};return u.forEach(Object.keys({...t,...n}),function(m){if(m==="__proto__"||m==="constructor"||m==="prototype")return;const b=u.hasOwnProp(c,m)?c[m]:s,B=b(t[m],n[m],m);u.isUndefined(B)&&b!==i||(o[m]=B)}),o}const ct=t=>{const n=Z({},t);let{data:o,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:l,headers:a,auth:i}=n;if(n.headers=a=U.from(a),n.url=Ze(at(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),i&&a.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),u.isFormData(o)){if(z.hasStandardBrowserEnv||z.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(u.isFunction(o.getHeaders)){const c=o.getHeaders(),p=["content-type","content-length"];Object.entries(c).forEach(([m,b])=>{p.includes(m.toLowerCase())&&a.set(m,b)})}}if(z.hasStandardBrowserEnv&&(r&&u.isFunction(r)&&(r=r(n)),r||r!==!1&&$o(n.url))){const c=s&&l&&Do.read(l);c&&a.set(s,c)}return n},Po=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(o,r){const s=ct(t);let l=s.data;const a=U.from(s.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:p}=s,m,b,B,C,d;function w(){C&&C(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(m),s.signal&&s.signal.removeEventListener("abort",m)}let f=new XMLHttpRequest;f.open(s.method.toUpperCase(),s.url,!0),f.timeout=s.timeout;function E(){if(!f)return;const N=U.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),R={data:!i||i==="text"||i==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:N,config:t,request:f};rt(function(g){o(g),w()},function(g){r(g),w()},R),f=null}"onloadend"in f?f.onloadend=E:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(E)},f.onabort=function(){f&&(r(new x("Request aborted",x.ECONNABORTED,t,f)),f=null)},f.onerror=function(O){const R=O&&O.message?O.message:"Network Error",h=new x(R,x.ERR_NETWORK,t,f);h.event=O||null,r(h),f=null},f.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const R=s.transitional||xe;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new x(O,R.clarifyTimeoutError?x.ETIMEDOUT:x.ECONNABORTED,t,f)),f=null},l===void 0&&a.setContentType(null),"setRequestHeader"in f&&u.forEach(a.toJSON(),function(O,R){f.setRequestHeader(R,O)}),u.isUndefined(s.withCredentials)||(f.withCredentials=!!s.withCredentials),i&&i!=="json"&&(f.responseType=s.responseType),p&&([B,d]=ye(p,!0),f.addEventListener("progress",B)),c&&f.upload&&([b,C]=ye(c),f.upload.addEventListener("progress",b),f.upload.addEventListener("loadend",C)),(s.cancelToken||s.signal)&&(m=N=>{f&&(r(!N||N.type?new de(null,t,f):N),f.abort(),f=null)},s.cancelToken&&s.cancelToken.subscribe(m),s.signal&&(s.signal.aborted?m():s.signal.addEventListener("abort",m)));const T=xo(s.url);if(T&&z.protocols.indexOf(T)===-1){r(new x("Unsupported protocol "+T+":",x.ERR_BAD_REQUEST,t));return}f.send(l||null)})},Vo=(t,n)=>{const{length:o}=t=t?t.filter(Boolean):[];if(n||o){let r=new AbortController,s;const l=function(p){if(!s){s=!0,i();const m=p instanceof Error?p:this.reason;r.abort(m instanceof x?m:new de(m instanceof Error?m.message:m))}};let a=n&&setTimeout(()=>{a=null,l(new x(`timeout of ${n}ms exceeded`,x.ETIMEDOUT))},n);const i=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(p=>{p.unsubscribe?p.unsubscribe(l):p.removeEventListener("abort",l)}),t=null)};t.forEach(p=>p.addEventListener("abort",l));const{signal:c}=r;return c.unsubscribe=()=>u.asap(i),c}},vo=function*(t,n){let o=t.byteLength;if(o<n){yield t;return}let r=0,s;for(;r<o;)s=r+n,yield t.slice(r,s),r=s},Lo=async function*(t,n){for await(const o of zo(t))yield*vo(o,n)},zo=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:o,value:r}=await n.read();if(o)break;yield r}}finally{await n.cancel()}},dt=(t,n,o,r)=>{const s=Lo(t,n);let l=0,a,i=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:p,value:m}=await s.next();if(p){i(),c.close();return}let b=m.byteLength;if(o){let B=l+=b;o(B)}c.enqueue(new Uint8Array(m))}catch(p){throw i(p),p}},cancel(c){return i(c),s.return()}},{highWaterMark:2})},ut=64*1024,{isFunction:be}=u,Fo=(({Request:t,Response:n})=>({Request:t,Response:n}))(u.global),{ReadableStream:ft,TextEncoder:pt}=u.global,mt=(t,...n)=>{try{return!!t(...n)}catch{return!1}},jo=t=>{t=u.merge.call({skipUndefined:!0},Fo,t);const{fetch:n,Request:o,Response:r}=t,s=n?be(n):typeof fetch=="function",l=be(o),a=be(r);if(!s)return!1;const i=s&&be(ft),c=s&&(typeof pt=="function"?(d=>w=>d.encode(w))(new pt):async d=>new Uint8Array(await new o(d).arrayBuffer())),p=l&&i&&mt(()=>{let d=!1;const w=new o(z.origin,{body:new ft,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!w}),m=a&&i&&mt(()=>u.isReadableStream(new r("").body)),b={stream:m&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!b[d]&&(b[d]=(w,f)=>{let E=w&&w[d];if(E)return E.call(w);throw new x(`Response type '${d}' is not supported`,x.ERR_NOT_SUPPORT,f)})});const B=async d=>{if(d==null)return 0;if(u.isBlob(d))return d.size;if(u.isSpecCompliantForm(d))return(await new o(z.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(u.isArrayBufferView(d)||u.isArrayBuffer(d))return d.byteLength;if(u.isURLSearchParams(d)&&(d=d+""),u.isString(d))return(await c(d)).byteLength},C=async(d,w)=>{const f=u.toFiniteNumber(d.getContentLength());return f??B(w)};return async d=>{let{url:w,method:f,data:E,signal:T,cancelToken:N,timeout:O,onDownloadProgress:R,onUploadProgress:h,responseType:g,headers:k,withCredentials:D="same-origin",fetchOptions:P}=ct(d),F=n||fetch;g=g?(g+"").toLowerCase():"text";let V=Vo([T,N&&N.toAbortSignal()],O),A=null;const _=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let y;try{if(h&&p&&f!=="get"&&f!=="head"&&(y=await C(k,E))!==0){let L=new o(w,{method:"POST",body:E,duplex:"half"}),q;if(u.isFormData(E)&&(q=L.headers.get("content-type"))&&k.setContentType(q),L.body){const[Ve,ke]=st(y,ye(lt(h)));E=dt(L.body,ut,Ve,ke)}}u.isString(D)||(D=D?"include":"omit");const S=l&&"credentials"in o.prototype,$={...P,signal:V,method:f.toUpperCase(),headers:k.normalize().toJSON(),body:E,duplex:"half",credentials:S?D:void 0};A=l&&new o(w,$);let M=await(l?F(A,P):F(w,$));const I=m&&(g==="stream"||g==="response");if(m&&(R||I&&_)){const L={};["status","statusText","headers"].forEach(Tt=>{L[Tt]=M[Tt]});const q=u.toFiniteNumber(M.headers.get("content-length")),[Ve,ke]=R&&st(q,ye(lt(R),!0))||[];M=new r(dt(M.body,ut,Ve,()=>{ke&&ke(),_&&_()}),L)}g=g||"text";let G=await b[u.findKey(b,g)||"text"](M,d);return!I&&_&&_(),await new Promise((L,q)=>{rt(L,q,{data:G,headers:U.from(M.headers),status:M.status,statusText:M.statusText,config:d,request:A})})}catch(S){throw _&&_(),S&&S.name==="TypeError"&&/Load failed|fetch/i.test(S.message)?Object.assign(new x("Network Error",x.ERR_NETWORK,d,A,S&&S.response),{cause:S.cause||S}):x.from(S,S&&S.code,d,A,S&&S.response)}}},Uo=new Map,ht=t=>{let n=t&&t.env||{};const{fetch:o,Request:r,Response:s}=n,l=[r,s,o];let a=l.length,i=a,c,p,m=Uo;for(;i--;)c=l[i],p=m.get(c),p===void 0&&m.set(c,p=i?new Map:jo(n)),m=p;return p};ht();const Me={http:co,xhr:Po,fetch:{get:ht}};u.forEach(Me,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const gt=t=>`- ${t}`,Io=t=>u.isFunction(t)||t===null||t===!1;function qo(t,n){t=u.isArray(t)?t:[t];const{length:o}=t;let r,s;const l={};for(let a=0;a<o;a++){r=t[a];let i;if(s=r,!Io(r)&&(s=Me[(i=String(r)).toLowerCase()],s===void 0))throw new x(`Unknown adapter '${i}'`);if(s&&(u.isFunction(s)||(s=s.get(n))))break;l[i||"#"+a]=s}if(!s){const a=Object.entries(l).map(([c,p])=>`adapter ${c} `+(p===!1?"is not supported by the environment":"is not available in the build"));let i=o?a.length>1?`since :
|
|
4
4
|
`+a.map(gt).join(`
|
|
5
5
|
`):" "+gt(a[0]):"as no adapter specified";throw new x("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s}const wt={getAdapter:qo,adapters:Me};function Ae(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new de(null,t)}function yt(t){return Ae(t),t.headers=U.from(t.headers),t.data=De.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),wt.getAdapter(t.adapter||ie.adapter,t)(t).then(function(r){return Ae(t),r.data=De.call(t,t.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return ot(r)||(Ae(t),r&&r.response&&(r.response.data=De.call(t,t.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const bt="1.13.5",Se={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{Se[t]=function(r){return typeof r===t||"a"+(n<1?"n ":" ")+t}});const St={};Se.transitional=function(n,o,r){function s(l,a){return"[Axios v"+bt+"] Transitional option '"+l+"'"+a+(r?". "+r:"")}return(l,a,i)=>{if(n===!1)throw new x(s(a," has been removed"+(o?" in "+o:"")),x.ERR_DEPRECATED);return o&&!St[a]&&(St[a]=!0,console.warn(s(a," has been deprecated since v"+o+" and will be removed in the near future"))),n?n(l,a,i):!0}},Se.spelling=function(n){return(o,r)=>(console.warn(`${r} is likely a misspelling of ${n}`),!0)};function Ho(t,n,o){if(typeof t!="object")throw new x("options must be an object",x.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const l=r[s],a=n[l];if(a){const i=t[l],c=i===void 0||a(i,l,t);if(c!==!0)throw new x("option "+l+" must be "+c,x.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new x("Unknown option "+l,x.ERR_BAD_OPTION)}}const Ee={assertOptions:Ho,validators:Se},W=Ee.validators;let ee=class{constructor(n){this.defaults=n||{},this.interceptors={request:new et,response:new et}}async request(n,o){try{return await this._request(n,o)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const l=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
-
`+l):r.stack=l}catch{}}throw r}}_request(n,o){typeof n=="string"?(o=o||{},o.url=n):o=n||{},o=Z(this.defaults,o);const{transitional:r,paramsSerializer:s,headers:l}=o;r!==void 0&&Ee.assertOptions(r,{silentJSONParsing:W.transitional(W.boolean),forcedJSONParsing:W.transitional(W.boolean),clarifyTimeoutError:W.transitional(W.boolean),legacyInterceptorReqResOrdering:W.transitional(W.boolean)},!1),s!=null&&(u.isFunction(s)?o.paramsSerializer={serialize:s}:Ee.assertOptions(s,{encode:W.function,serialize:W.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Ee.assertOptions(o,{baseUrl:W.spelling("baseURL"),withXsrfToken:W.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let a=l&&u.merge(l.common,l[o.method]);l&&u.forEach(["delete","get","head","post","put","patch","common"],d=>{delete l[d]}),o.headers=U.concat(a,l);const i=[];let c=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(o)===!1)return;c=c&&w.synchronous;const f=o.transitional||xe;f&&f.legacyInterceptorReqResOrdering?i.unshift(w.fulfilled,w.rejected):i.push(w.fulfilled,w.rejected)});const p=[];this.interceptors.response.forEach(function(w){p.push(w.fulfilled,w.rejected)});let m,b=0,B;if(!c){const d=[yt.bind(this),void 0];for(d.unshift(...i),d.push(...p),B=d.length,m=Promise.resolve(o);b<B;)m=m.then(d[b++],d[b++]);return m}B=i.length;let C=o;for(;b<B;){const d=i[b++],w=i[b++];try{C=d(C)}catch(f){w.call(this,f);break}}try{m=yt.call(this,C)}catch(d){return Promise.reject(d)}for(b=0,B=p.length;b<B;)m=m.then(p[b++],p[b++]);return m}getUri(n){n=Z(this.defaults,n);const o=at(n.baseURL,n.url,n.allowAbsoluteUrls);return Ze(o,n.params,n.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(n){ee.prototype[n]=function(o,r){return this.request(Z(r||{},{method:n,url:o,data:(r||{}).data}))}}),u.forEach(["post","put","patch"],function(n){function o(r){return function(l,a,i){return this.request(Z(i||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:a}))}}ee.prototype[n]=o(),ee.prototype[n+"Form"]=o(!0)});let Wo=class Rt{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(l){o=l});const r=this;this.promise.then(s=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const a=new Promise(i=>{r.subscribe(i),l=i}).then(s);return a.cancel=function(){r.unsubscribe(l)},a},n(function(l,a,i){r.reason||(r.reason=new de(l,a,i),o(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const o=this._listeners.indexOf(n);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const n=new AbortController,o=r=>{n.abort(r)};return this.subscribe(o),n.signal.unsubscribe=()=>this.unsubscribe(o),n.signal}static source(){let n;return{token:new Rt(function(s){n=s}),cancel:n}}};function Yo(t){return function(o){return t.apply(null,o)}}function Jo(t){return u.isObject(t)&&t.isAxiosError===!0}const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pe).forEach(([t,n])=>{Pe[n]=t});function Et(t){const n=new ee(t),o=Fe(ee.prototype.request,n);return u.extend(o,ee.prototype,n,{allOwnKeys:!0}),u.extend(o,n,null,{allOwnKeys:!0}),o.create=function(s){return Et(Z(t,s))},o}const v=Et(ie);v.Axios=ee,v.CanceledError=de,v.CancelToken=Wo,v.isCancel=ot,v.VERSION=bt,v.toFormData=ge,v.AxiosError=x,v.Cancel=v.CanceledError,v.all=function(n){return Promise.all(n)},v.spread=Yo,v.isAxiosError=Jo,v.mergeConfig=Z,v.AxiosHeaders=U,v.formToJSON=t=>tt(u.isHTMLForm(t)?new FormData(t):t),v.getAdapter=wt.getAdapter,v.HttpStatusCode=Pe,v.default=v;const{Axios:Pr,AxiosError:Vr,CanceledError:vr,isCancel:Lr,CancelToken:zr,VERSION:Fr,all:jr,Cancel:Ur,isAxiosError:Ir,spread:qr,toFormData:Hr,AxiosHeaders:Wr,HttpStatusCode:Yr,formToJSON:Jr,getAdapter:Xr,mergeConfig:Gr}=v,Xo={class:"popup"},Go={class:"wrapper"},Ko={class:"scrollbar"},Qo=["onClick"],Zo=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"SwSelect",props:e.mergeModels({class:{default:""},size:{default:"large"},placeholder:{default:""},token:{default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.ref({fullText:""}),o=e.ref(!1),r=e.ref([]),s=e.useModel(t,"modelValue"),l=t;e.watch(()=>s.value?.text,c=>{c&&c.length>3&&(n.value.fullText=c)}),e.watch(n.value.fullText,(c,p)=>{o.value=c.length>3&&c.length>p.length,c.length>3&&a()});const a=()=>{let c="https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address";console.log(n.value.fullText),v.post(c,{query:n.value.fullText},{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Token "+l.token}}).then(p=>{console.log(p.data.suggestions),r.value=p.data.suggestions,r.value.length===1&&i(r.value[0])}).catch(p=>{console.log(p)})},i=c=>{n.value.fullText=c.value,o.value=!1;const p={};p.text=c.value,p.coords=[Number(c.data.geo_lat),Number(c.data.geo_lon)],p.suggestion=c.data,s.value=p};return(c,p)=>{const m=e.resolveComponent("sw-input");return e.openBlock(),e.createElementBlock("div",Xo,[e.createVNode(m,{size:l.size,modelValue:n.value.fullText,"onUpdate:modelValue":p[0]||(p[0]=b=>n.value.fullText=b),placeholder:l.placeholder},null,8,["size","modelValue","placeholder"]),e.withDirectives(e.createElementVNode("div",Go,[e.createElementVNode("ul",Ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(b,B)=>(e.openBlock(),e.createElementBlock("li",{tabindex:"1",key:B,onClick:C=>i(b)},e.toDisplayString(b.value),9,Qo))),128))])],512),[[e.vShow,o.value]])])}}})},Symbol.toStringTag,{value:"Module"})),er={key:0},kt={__name:"SwSkeletonItem",props:{width:{type:String,default:"100"},class:{type:String,default:""},animate:{type:Boolean,default:!1},size:{type:String,default:""}},setup(t){const n=t,o=e.computed(()=>{let s=["sw-skeleton-item"];return n.size.length>0&&s.push("sw-"+n.size),n.animate&&s.push("sw-animate"),n.class.length>0&&s.push(n.class),s}),r=e.computed(()=>({width:n.width+"%"}));return(s,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.value),style:e.normalizeStyle(r.value)},[n.animate?(e.openBlock(),e.createElementBlock("div",er)):e.createCommentVNode("",!0)],6))}},tr=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"})),nr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSkeleton",props:{class:{type:String,default:""},visual:{type:Boolean,default:!1}},setup(t){const n=t;return(o,r)=>n.visual?e.renderSlot(o.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["sw-skeleton",n.class])},[e.renderSlot(o.$slots,"skeleton",{},()=>[e.createVNode(kt,{animate:"",size:"small"})])],2))}}},Symbol.toStringTag,{value:"Module"})),or=["onMouseenter","onMouseleave","onFocus","onBlur","onMousedown","onTouchstart"],rr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSlider",props:e.mergeModels({class:{type:String,default:""},size:{type:String,default:""},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},vertical:{type:Boolean,default:!1},showValue:{type:Boolean,default:!1}},{modelValue:{type:[Number,Array],required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue"),o=t,r=e.ref([]),s=e.ref([]),l=e.computed(()=>{let h=["sw-slider"];return o.size.length>0&&h.push("sw-"+o.size),o.class.length>0&&h.push(o.class),o.vertical&&h.push("vertical"),h}),a=h=>{const g=[...r.value];g[h]=!0,r.value=g},i=h=>{const g=[...r.value];g[h]=!1,r.value=g},c=h=>{const g=document.querySelector(".sw-slider");return g?Ot(g,o.vertical):o.vertical?{right:"100%",marginRight:"10px"}:{bottom:"100%",marginBottom:"10px"}},p=e.computed(()=>Array.isArray(n.value)),m=e.computed({get(){return p.value?[...n.value]:[n.value]},set(h){p.value?n.value=[...h].sort((g,k)=>g-k):n.value=h[0]}}),b=e.computed(()=>{const h=o.max-o.min;return m.value.map(g=>h===0?0:(g-o.min)/h*100)}),B=e.computed(()=>{if(o.vertical)if(p.value){const h=b.value[0]||0,g=b.value[b.value.length-1]||0,k=Math.min(h,g);return{height:`${Math.max(h,g)-k}%`,top:`${k}%`,left:"0",width:"100%"}}else return{height:`${b.value[0]||0}%`,top:"0",left:"0",width:"100%"};else if(p.value){const h=b.value[0]||0,g=b.value[b.value.length-1]||0,k=Math.min(h,g);return{width:`${Math.max(h,g)-k}%`,left:`${k}%`,top:"0",height:"100%"}}else return{width:`${b.value[0]||0}%`,left:"0",top:"0",height:"100%"}}),C=e.computed(()=>b.value.map((h,g)=>o.vertical?{top:`${h}%`,zIndex:m.value.length-g}:{left:`${h}%`,zIndex:m.value.length-g}));function d(h){if(p.value)return;const g=h.currentTarget.closest(".sw-slider");if(!g)return;const k=g.getBoundingClientRect(),D=o.vertical?(h.clientY-k.top)/k.height:(h.clientX-k.left)/k.width,P=Math.max(0,Math.min(1,D)),F=o.max-o.min;let V=o.min+P*F;const A=Math.round((V-o.min)/o.step);V=o.min+A*o.step,V=Math.max(o.min,Math.min(o.max,V)),m.value=[V],setTimeout(()=>{const _=[...s.value];_[0]=c(),s.value=_},0)}const w=e.ref(!1),f=e.ref(null),E=e.ref(null);function T(h,g){const k=h.target.closest(".sw-slider");k&&(E.value=k.getBoundingClientRect(),f.value=g,w.value=!0,R(h.clientX||h.touches?.[0]?.clientX,h.clientY||h.touches?.[0]?.clientY))}function N(h){if(!w.value)return;h.preventDefault?.();const g=h.clientX||h.touches?.[0]?.clientX,k=h.clientY||h.touches?.[0]?.clientY;R(g,k)}function O(){w.value=!1,f.value=null}function R(h,g){if(!E.value||f.value===null)return;const k=E.value,D=o.vertical?(g-k.top)/k.height:(h-k.left)/k.width,P=Math.max(0,Math.min(1,D)),F=o.max-o.min;let V=o.min+P*F;const A=Math.round((V-o.min)/o.step);V=o.min+A*o.step,V=Math.max(o.min,Math.min(o.max,V));const _=[...m.value];_[f.value]=V,m.value=_,setTimeout(()=>{const y=[...s.value];y[f.value]=c(f.value),s.value=y},0)}return e.onMounted(()=>{window.addEventListener("mousemove",N),window.addEventListener("mouseup",O),window.addEventListener("touchmove",N,{passive:!1}),window.addEventListener("touchend",O),r.value=new Array(m.value.length).fill(!1)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",O),window.removeEventListener("touchmove",N),window.removeEventListener("touchend",O)}),(h,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value)},[e.createElementVNode("div",{class:"track",onClick:d,onMousedown:g[0]||(g[0]=e.withModifiers(k=>T(k,0),["prevent"])),onTouchstart:g[1]||(g[1]=e.withModifiers(k=>T(k.touches[0],0),["prevent"]))},[e.createElementVNode("div",{class:"fill",style:e.normalizeStyle(B.value)},null,4)],32),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(k,D)=>(e.openBlock(),e.createElementBlock("div",{class:"thumb",key:D,style:e.normalizeStyle(C.value[D]),onMouseenter:P=>a(D),onMouseleave:P=>i(D),onFocus:P=>a(D),onBlur:P=>i(D),onMousedown:e.withModifiers(P=>T(P,D),["prevent"]),onTouchstart:e.withModifiers(P=>T(P.touches[0],D),["prevent"])},[e.renderSlot(h.$slots,"default",{index:D,value:k}),r.value[D]&&t.showValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tooltip",{"tooltip-vertical":o.vertical}]),style:e.normalizeStyle(c())},e.toDisplayString(k),7)):e.createCommentVNode("",!0)],44,or))),128))],2))}}},Symbol.toStringTag,{value:"Module"})),sr=["name","id","checked"],lr=["for","data-onlabel","data-offlabel"],ar=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"SwSwitch",props:e.mergeModels({id:{default:"checkbox"},class:{default:""},name:{default:""},on:{default:""},off:{default:""},size:{default:""},checkbox:{type:Boolean,default:!1}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue"),o=t,r=e.computed(()=>{let l=["sw-switch"];return o.size.length>0&&l.push("sw-"+o.size),o.checkbox&&l.push("sw-checkbox"),o.class.length>0&&l.push(o.class),l}),s=l=>{n.value=l.target.checked};return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(r.value)},[e.createElementVNode("input",{type:"checkbox",name:o.name,class:"sw-control",id:o.id,checked:n.value,onChange:s},null,40,sr),e.createElementVNode("label",{for:o.id,class:"sw-label","data-onlabel":o.on,"data-offlabel":o.off},null,8,lr),e.renderSlot(l.$slots,"default")],2))}})},Symbol.toStringTag,{value:"Module"})),ir={style:{display:"none"}},_t={__name:"SwTableColumn",props:{prop:{type:String,required:!0},label:{type:String,default:""},width:{type:String,default:"auto"},height:{type:String,default:"auto"}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",ir))}},cr=Object.freeze(Object.defineProperty({__proto__:null,default:_t},Symbol.toStringTag,{value:"Module"})),dr={class:"sw-table"},ur=["colspan","rowspan"],fr=["colspan","rowspan"],pr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTable",props:{data:{type:Array,required:!0}},setup(t){const n=t,o=e.useSlots(),r=e.ref([]);function s(d){const w=[];for(const f of d)if(f.type===_t){const E={...f.props,children:[]},T=f.children?.default?.();T&&T.length>0&&(E.children=s(T)),w.push(E)}return w}function l(d){if(!d||d.length===0)return 1;let w=1;for(const f of d)if(f.children&&f.children.length>0){const E=l(f.children);w=Math.max(w,1+E)}return w}function a(d,w){const f=Array.from({length:w},()=>[]);function E(T,N,O=""){for(let R=0;R<T.length;R++){const h=T[R],g=O?`${O}-${h.prop||R}`:h.prop||R;if(h.children&&h.children.length>0){const k=i(h.children);f[N].push({key:g,label:h.label,colspan:k,rowspan:1,width:h.width,height:h.height}),E(h.children,N+1,g)}else f[N].push({key:h.prop,label:h.label,colspan:1,rowspan:w-N,width:h.width,height:h.height,prop:h.prop})}}return E(d,0),f}function i(d){let w=0;function f(E){for(const T of E)T.children&&T.children.length>0?f(T.children):w++}return f(d),w}function c(d){const w=[];function f(E){for(const T of E)T.children&&T.children.length>0?f(T.children):w.push(T)}return f(d),w}function p(d,w){const f=[],E=new Map;return d.forEach((T,N)=>{const O=[];w.forEach((R,h)=>{const g=`${N}-${R.prop}`;if(E.has(g))return;const k=T[R.prop];let D=k,P=1,F=1,V={};k&&typeof k=="object"&&k!==null&&(D=k.label||k.value||"",P=k.colspan||1,F=k.rowspan||1,V=k.style||{});const A={key:g,label:D,prop:R.prop,colspan:P,rowspan:F,style:V,originalRow:T,rowIndex:N};O.push(A);for(let _=0;_<F;_++)for(let y=0;y<P;y++){if(_===0&&y===0)continue;const S=`${N+_}-${w[h+y]?.prop}`;S&&E.set(S,!0)}}),O.length>0&&f.push(O)}),f}e.onMounted(()=>{const d=o.default?.()||[];r.value=s(d)});const m=e.computed(()=>l(r.value)),b=e.computed(()=>a(r.value,m.value)),B=e.computed(()=>c(r.value)),C=e.computed(()=>p(n.data,B.value));return(d,w)=>(e.openBlock(),e.createElementBlock("table",dr,[e.createElementVNode("thead",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(f,E)=>(e.openBlock(),e.createElementBlock("tr",{key:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,T=>(e.openBlock(),e.createElementBlock("th",{key:T.key,colspan:T.colspan,rowspan:T.rowspan,style:e.normalizeStyle({minWidth:T.width,minHeight:T.height})},e.toDisplayString(T.label),13,ur))),128))]))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(f,E)=>(e.openBlock(),e.createElementBlock("tr",{key:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,T=>(e.openBlock(),e.createElementBlock("td",{key:T.key,colspan:T.colspan,rowspan:T.rowspan,style:e.normalizeStyle(T.style)},[e.renderSlot(d.$slots,T.prop,{row:T.originalRow,$index:T.rowIndex},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])],12,fr))),128))]))),128))])]))}}},Symbol.toStringTag,{value:"Module"})),mr={key:0},hr=["onClick"],gr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabs",props:e.mergeModels({class:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["tab-click"],["update:modelValue"]),setup(t,{emit:n}){e.ref(0);const o=e.ref([]),r=t,s=e.useModel(t,"modelValue"),l=n;function a(c){o.value.push(c)}function i(c){o.value=o.value.filter(p=>p!==c)}return e.provide("registerTab",a),e.provide("unregisterTab",i),e.provide("activeTab",s),e.provide("tabs",o),(c,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("sw-tabs "+r.class)},[o.value.length!==0?(e.openBlock(),e.createElementBlock("header",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,b)=>(e.openBlock(),e.createElementBlock("span",{key:b,class:e.normalizeClass([{active:s.value===b}]),onClick:B=>{s.value=b,l("tab-click",b)}},e.toDisplayString(m.label||m.title),11,hr))),128))])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),wr={key:0,class:"tab-content"},yr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsPane",props:{title:{type:String,required:!0},label:{type:String,default:""}},setup(t){const n=t,o=e.inject("registerTab"),r=e.inject("unregisterTab");e.onMounted(()=>{o({title:n.title,label:n.label})}),e.onUnmounted(()=>{r({title:n.title,label:n.label})});const s=e.inject("activeTab"),l=e.inject("tabs"),a=e.computed(()=>l.value.findIndex(c=>c.title===n.title)),i=e.computed(()=>s.value===a.value);return(c,p)=>i.value?(e.openBlock(),e.createElementBlock("div",wr,[e.renderSlot(c.$slots,"default")])):e.createCommentVNode("",!0)}}},Symbol.toStringTag,{value:"Module"}));J.Alert=_e,J.Library=Mt,J.components=ue,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|
|
6
|
+
`+l):r.stack=l}catch{}}throw r}}_request(n,o){typeof n=="string"?(o=o||{},o.url=n):o=n||{},o=Z(this.defaults,o);const{transitional:r,paramsSerializer:s,headers:l}=o;r!==void 0&&Ee.assertOptions(r,{silentJSONParsing:W.transitional(W.boolean),forcedJSONParsing:W.transitional(W.boolean),clarifyTimeoutError:W.transitional(W.boolean),legacyInterceptorReqResOrdering:W.transitional(W.boolean)},!1),s!=null&&(u.isFunction(s)?o.paramsSerializer={serialize:s}:Ee.assertOptions(s,{encode:W.function,serialize:W.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Ee.assertOptions(o,{baseUrl:W.spelling("baseURL"),withXsrfToken:W.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let a=l&&u.merge(l.common,l[o.method]);l&&u.forEach(["delete","get","head","post","put","patch","common"],d=>{delete l[d]}),o.headers=U.concat(a,l);const i=[];let c=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(o)===!1)return;c=c&&w.synchronous;const f=o.transitional||xe;f&&f.legacyInterceptorReqResOrdering?i.unshift(w.fulfilled,w.rejected):i.push(w.fulfilled,w.rejected)});const p=[];this.interceptors.response.forEach(function(w){p.push(w.fulfilled,w.rejected)});let m,b=0,B;if(!c){const d=[yt.bind(this),void 0];for(d.unshift(...i),d.push(...p),B=d.length,m=Promise.resolve(o);b<B;)m=m.then(d[b++],d[b++]);return m}B=i.length;let C=o;for(;b<B;){const d=i[b++],w=i[b++];try{C=d(C)}catch(f){w.call(this,f);break}}try{m=yt.call(this,C)}catch(d){return Promise.reject(d)}for(b=0,B=p.length;b<B;)m=m.then(p[b++],p[b++]);return m}getUri(n){n=Z(this.defaults,n);const o=at(n.baseURL,n.url,n.allowAbsoluteUrls);return Ze(o,n.params,n.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(n){ee.prototype[n]=function(o,r){return this.request(Z(r||{},{method:n,url:o,data:(r||{}).data}))}}),u.forEach(["post","put","patch"],function(n){function o(r){return function(l,a,i){return this.request(Z(i||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:a}))}}ee.prototype[n]=o(),ee.prototype[n+"Form"]=o(!0)});let Wo=class Rt{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(l){o=l});const r=this;this.promise.then(s=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const a=new Promise(i=>{r.subscribe(i),l=i}).then(s);return a.cancel=function(){r.unsubscribe(l)},a},n(function(l,a,i){r.reason||(r.reason=new de(l,a,i),o(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const o=this._listeners.indexOf(n);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const n=new AbortController,o=r=>{n.abort(r)};return this.subscribe(o),n.signal.unsubscribe=()=>this.unsubscribe(o),n.signal}static source(){let n;return{token:new Rt(function(s){n=s}),cancel:n}}};function Yo(t){return function(o){return t.apply(null,o)}}function Jo(t){return u.isObject(t)&&t.isAxiosError===!0}const Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Pe).forEach(([t,n])=>{Pe[n]=t});function Et(t){const n=new ee(t),o=Fe(ee.prototype.request,n);return u.extend(o,ee.prototype,n,{allOwnKeys:!0}),u.extend(o,n,null,{allOwnKeys:!0}),o.create=function(s){return Et(Z(t,s))},o}const v=Et(ie);v.Axios=ee,v.CanceledError=de,v.CancelToken=Wo,v.isCancel=ot,v.VERSION=bt,v.toFormData=ge,v.AxiosError=x,v.Cancel=v.CanceledError,v.all=function(n){return Promise.all(n)},v.spread=Yo,v.isAxiosError=Jo,v.mergeConfig=Z,v.AxiosHeaders=U,v.formToJSON=t=>tt(u.isHTMLForm(t)?new FormData(t):t),v.getAdapter=wt.getAdapter,v.HttpStatusCode=Pe,v.default=v;const{Axios:Pr,AxiosError:Vr,CanceledError:vr,isCancel:Lr,CancelToken:zr,VERSION:Fr,all:jr,Cancel:Ur,isAxiosError:Ir,spread:qr,toFormData:Hr,AxiosHeaders:Wr,HttpStatusCode:Yr,formToJSON:Jr,getAdapter:Xr,mergeConfig:Gr}=v,Xo={class:"popup"},Go={class:"wrapper"},Ko={class:"scrollbar"},Qo=["onClick"],Zo=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"SwSelect",props:e.mergeModels({class:{default:""},size:{default:"large"},placeholder:{default:""},token:{default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.ref({fullText:""}),o=e.ref(!1),r=e.ref([]),s=e.useModel(t,"modelValue"),l=t;e.watch(()=>s.value?.text,c=>{c&&c.length>3&&(n.value.fullText=c)}),e.watch(n.value.fullText,(c,p)=>{o.value=c.length>3&&c.length>p.length,c.length>3&&a()});const a=()=>{let c="https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address";console.log(n.value.fullText),v.post(c,{query:n.value.fullText},{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Token "+l.token}}).then(p=>{console.log(p.data.suggestions),r.value=p.data.suggestions,r.value.length===1&&i(r.value[0])}).catch(p=>{console.log(p)})},i=c=>{n.value.fullText=c.value,o.value=!1;const p={};p.text=c.value,p.coords=[Number(c.data.geo_lat),Number(c.data.geo_lon)],p.suggestion=c.data,s.value=p};return(c,p)=>{const m=e.resolveComponent("sw-input");return e.openBlock(),e.createElementBlock("div",Xo,[e.createVNode(m,{size:l.size,modelValue:n.value.fullText,"onUpdate:modelValue":p[0]||(p[0]=b=>n.value.fullText=b),placeholder:l.placeholder},null,8,["size","modelValue","placeholder"]),e.withDirectives(e.createElementVNode("div",Go,[e.createElementVNode("ul",Ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(b,B)=>(e.openBlock(),e.createElementBlock("li",{tabindex:"1",key:B,onClick:C=>i(b)},e.toDisplayString(b.value),9,Qo))),128))])],512),[[e.vShow,o.value]])])}}})},Symbol.toStringTag,{value:"Module"})),er={key:0},kt={__name:"SwSkeletonItem",props:{width:{type:String,default:"100"},class:{type:String,default:""},animate:{type:Boolean,default:!1},size:{type:String,default:""}},setup(t){const n=t,o=e.computed(()=>{let s=["sw-skeleton-item"];return n.size.length>0&&s.push("sw-"+n.size),n.animate&&s.push("sw-animate"),n.class.length>0&&s.push(n.class),s}),r=e.computed(()=>({width:n.width+"%"}));return(s,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.value),style:e.normalizeStyle(r.value)},[n.animate?(e.openBlock(),e.createElementBlock("div",er)):e.createCommentVNode("",!0)],6))}},tr=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"})),nr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSkeleton",props:{class:{type:String,default:""},visual:{type:Boolean,default:!1}},setup(t){const n=t;return(o,r)=>n.visual?e.renderSlot(o.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["sw-skeleton",n.class])},[e.renderSlot(o.$slots,"skeleton",{},()=>[e.createVNode(kt,{animate:"",size:"small"})])],2))}}},Symbol.toStringTag,{value:"Module"})),or=["onMouseenter","onMouseleave","onFocus","onBlur","onMousedown","onTouchstart"],rr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwSlider",props:e.mergeModels({class:{type:String,default:""},size:{type:String,default:""},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},vertical:{type:Boolean,default:!1},showValue:{type:Boolean,default:!1}},{modelValue:{type:[Number,Array],required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue"),o=t,r=e.ref([]),s=e.ref([]),l=e.computed(()=>{let h=["sw-slider"];return o.size.length>0&&h.push("sw-"+o.size),o.class.length>0&&h.push(o.class),o.vertical&&h.push("vertical"),h}),a=h=>{const g=[...r.value];g[h]=!0,r.value=g},i=h=>{const g=[...r.value];g[h]=!1,r.value=g},c=h=>{const g=document.querySelector(".sw-slider");return g?Ot(g,o.vertical):o.vertical?{right:"100%",marginRight:"10px"}:{bottom:"100%",marginBottom:"10px"}},p=e.computed(()=>Array.isArray(n.value)),m=e.computed({get(){return p.value?[...n.value]:[n.value]},set(h){p.value?n.value=[...h].sort((g,k)=>g-k):n.value=h[0]}}),b=e.computed(()=>{const h=o.max-o.min;return m.value.map(g=>h===0?0:(g-o.min)/h*100)}),B=e.computed(()=>{if(o.vertical)if(p.value){const h=b.value[0]||0,g=b.value[b.value.length-1]||0,k=Math.min(h,g);return{height:`${Math.max(h,g)-k}%`,top:`${k}%`,left:"0",width:"100%"}}else return{height:`${b.value[0]||0}%`,top:"0",left:"0",width:"100%"};else if(p.value){const h=b.value[0]||0,g=b.value[b.value.length-1]||0,k=Math.min(h,g);return{width:`${Math.max(h,g)-k}%`,left:`${k}%`,top:"0",height:"100%"}}else return{width:`${b.value[0]||0}%`,left:"0",top:"0",height:"100%"}}),C=e.computed(()=>b.value.map((h,g)=>o.vertical?{top:`${h}%`,zIndex:m.value.length-g}:{left:`${h}%`,zIndex:m.value.length-g}));function d(h){if(p.value)return;const g=h.currentTarget.closest(".sw-slider");if(!g)return;const k=g.getBoundingClientRect(),D=o.vertical?(h.clientY-k.top)/k.height:(h.clientX-k.left)/k.width,P=Math.max(0,Math.min(1,D)),F=o.max-o.min;let V=o.min+P*F;const A=Math.round((V-o.min)/o.step);V=o.min+A*o.step,V=Math.max(o.min,Math.min(o.max,V)),m.value=[V],setTimeout(()=>{const _=[...s.value];_[0]=c(),s.value=_},0)}const w=e.ref(!1),f=e.ref(null),E=e.ref(null);function T(h,g){const k=h.target.closest(".sw-slider");k&&(E.value=k.getBoundingClientRect(),f.value=g,w.value=!0,R(h.clientX||h.touches?.[0]?.clientX,h.clientY||h.touches?.[0]?.clientY))}function N(h){if(!w.value)return;h.preventDefault?.();const g=h.clientX||h.touches?.[0]?.clientX,k=h.clientY||h.touches?.[0]?.clientY;R(g,k)}function O(){w.value=!1,f.value=null}function R(h,g){if(!E.value||f.value===null)return;const k=E.value,D=o.vertical?(g-k.top)/k.height:(h-k.left)/k.width,P=Math.max(0,Math.min(1,D)),F=o.max-o.min;let V=o.min+P*F;const A=Math.round((V-o.min)/o.step);V=o.min+A*o.step,V=Math.max(o.min,Math.min(o.max,V));const _=[...m.value];_[f.value]=V,m.value=_,setTimeout(()=>{const y=[...s.value];y[f.value]=c(f.value),s.value=y},0)}return e.onMounted(()=>{window.addEventListener("mousemove",N),window.addEventListener("mouseup",O),window.addEventListener("touchmove",N,{passive:!1}),window.addEventListener("touchend",O),r.value=new Array(m.value.length).fill(!1)}),e.onUnmounted(()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",O),window.removeEventListener("touchmove",N),window.removeEventListener("touchend",O)}),(h,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(l.value)},[e.createElementVNode("div",{class:"track",onClick:d,onMousedown:g[0]||(g[0]=e.withModifiers(k=>T(k,0),["prevent"])),onTouchstart:g[1]||(g[1]=e.withModifiers(k=>T(k.touches[0],0),["prevent"]))},[e.createElementVNode("div",{class:"fill",style:e.normalizeStyle(B.value)},null,4)],32),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(k,D)=>(e.openBlock(),e.createElementBlock("div",{class:"thumb",key:D,style:e.normalizeStyle(C.value[D]),onMouseenter:P=>a(D),onMouseleave:P=>i(D),onFocus:P=>a(D),onBlur:P=>i(D),onMousedown:e.withModifiers(P=>T(P,D),["prevent"]),onTouchstart:e.withModifiers(P=>T(P.touches[0],D),["prevent"])},[e.renderSlot(h.$slots,"default",{index:D,value:k}),r.value[D]&&t.showValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["tooltip",{"tooltip-vertical":o.vertical}]),style:e.normalizeStyle(c())},e.toDisplayString(k),7)):e.createCommentVNode("",!0)],44,or))),128))],2))}}},Symbol.toStringTag,{value:"Module"})),sr=["name","id","checked"],lr=["for","data-onlabel","data-offlabel"],ar=Object.freeze(Object.defineProperty({__proto__:null,default:e.defineComponent({__name:"SwSwitch",props:e.mergeModels({id:{default:"checkbox"},class:{default:""},name:{default:""},on:{default:""},off:{default:""},size:{default:""},checkbox:{type:Boolean,default:!1}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const n=e.useModel(t,"modelValue"),o=t,r=e.computed(()=>{let l=["sw-switch"];return o.size.length>0&&l.push("sw-"+o.size),o.checkbox&&l.push("sw-checkbox"),o.class.length>0&&l.push(o.class),l}),s=l=>{n.value=l.target.checked};return(l,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(r.value)},[e.createElementVNode("input",{type:"checkbox",name:o.name,class:"sw-control",id:o.id,checked:n.value,onChange:s},null,40,sr),e.createElementVNode("label",{for:o.id,class:"sw-label","data-onlabel":o.on,"data-offlabel":o.off},null,8,lr),e.renderSlot(l.$slots,"default")],2))}})},Symbol.toStringTag,{value:"Module"})),ir={style:{display:"none"}},_t={__name:"SwTableColumn",props:{prop:{type:String,required:!0},label:{type:String,default:""},width:{type:String,default:"auto"},height:{type:String,default:"auto"}},setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",ir))}},cr=Object.freeze(Object.defineProperty({__proto__:null,default:_t},Symbol.toStringTag,{value:"Module"})),dr={class:"sw-table"},ur=["colspan","rowspan"],fr=["colspan","rowspan"],pr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTable",props:{data:{type:Array,required:!0}},setup(t){const n=t,o=e.useSlots(),r=e.ref([]);function s(d){const w=[];for(const f of d)if(f.type===_t){const E={...f.props,children:[]},T=f.children?.default?.();T&&T.length>0&&(E.children=s(T)),w.push(E)}return w}function l(d){if(!d||d.length===0)return 1;let w=1;for(const f of d)if(f.children&&f.children.length>0){const E=l(f.children);w=Math.max(w,1+E)}return w}function a(d,w){const f=Array.from({length:w},()=>[]);function E(T,N,O=""){for(let R=0;R<T.length;R++){const h=T[R],g=O?`${O}-${h.prop||R}`:h.prop||R;if(h.children&&h.children.length>0){const k=i(h.children);f[N].push({key:g,label:h.label,colspan:k,rowspan:1,width:h.width,height:h.height}),E(h.children,N+1,g)}else f[N].push({key:h.prop,label:h.label,colspan:1,rowspan:w-N,width:h.width,height:h.height,prop:h.prop})}}return E(d,0),f}function i(d){let w=0;function f(E){for(const T of E)T.children&&T.children.length>0?f(T.children):w++}return f(d),w}function c(d){const w=[];function f(E){for(const T of E)T.children&&T.children.length>0?f(T.children):w.push(T)}return f(d),w}function p(d,w){const f=[],E=new Map;return d.forEach((T,N)=>{const O=[];w.forEach((R,h)=>{const g=`${N}-${R.prop}`;if(E.has(g))return;const k=T[R.prop];let D=k,P=1,F=1,V={};k&&typeof k=="object"&&k!==null&&(D=k.label||k.value||"",P=k.colspan||1,F=k.rowspan||1,V=k.style||{});const A={key:g,label:D,prop:R.prop,colspan:P,rowspan:F,style:V,originalRow:T,rowIndex:N};O.push(A);for(let _=0;_<F;_++)for(let y=0;y<P;y++){if(_===0&&y===0)continue;const S=`${N+_}-${w[h+y]?.prop}`;S&&E.set(S,!0)}}),O.length>0&&f.push(O)}),f}e.onMounted(()=>{const d=o.default?.()||[];r.value=s(d),console.log("SwTable mounted - columnTree:",r.value),console.log("SwTable mounted - data:",n.data)});const m=e.computed(()=>l(r.value)),b=e.computed(()=>a(r.value,m.value)),B=e.computed(()=>c(r.value)),C=e.computed(()=>p(n.data,B.value));return(d,w)=>(e.openBlock(),e.createElementBlock("table",dr,[e.createElementVNode("thead",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(f,E)=>(e.openBlock(),e.createElementBlock("tr",{key:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,T=>(e.openBlock(),e.createElementBlock("th",{key:T.key,colspan:T.colspan,rowspan:T.rowspan,style:e.normalizeStyle({minWidth:T.width,minHeight:T.height})},e.toDisplayString(T.label),13,ur))),128))]))),128))]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(f,E)=>(e.openBlock(),e.createElementBlock("tr",{key:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f,T=>(e.openBlock(),e.createElementBlock("td",{key:T.key,colspan:T.colspan,rowspan:T.rowspan,style:e.normalizeStyle(T.style)},[e.renderSlot(d.$slots,T.prop,{row:T.originalRow,$index:T.rowIndex},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])],12,fr))),128))]))),128))])]))}}},Symbol.toStringTag,{value:"Module"})),mr={key:0},hr=["onClick"],gr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabs",props:e.mergeModels({class:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["tab-click"],["update:modelValue"]),setup(t,{emit:n}){e.ref(0);const o=e.ref([]),r=t,s=e.useModel(t,"modelValue"),l=n;function a(c){o.value.push(c)}function i(c){o.value=o.value.filter(p=>p!==c)}return e.provide("registerTab",a),e.provide("unregisterTab",i),e.provide("activeTab",s),e.provide("tabs",o),(c,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("sw-tabs "+r.class)},[o.value.length!==0?(e.openBlock(),e.createElementBlock("header",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,b)=>(e.openBlock(),e.createElementBlock("span",{key:b,class:e.normalizeClass([{active:s.value===b}]),onClick:B=>{s.value=b,l("tab-click",b)}},e.toDisplayString(m.label||m.title),11,hr))),128))])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"default")],2))}}},Symbol.toStringTag,{value:"Module"})),wr={key:0,class:"tab-content"},yr=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"SwTabsPane",props:{title:{type:String,required:!0},label:{type:String,default:""}},setup(t){const n=t,o=e.inject("registerTab"),r=e.inject("unregisterTab");e.onMounted(()=>{o({title:n.title,label:n.label})}),e.onUnmounted(()=>{r({title:n.title,label:n.label})});const s=e.inject("activeTab"),l=e.inject("tabs"),a=e.computed(()=>l.value.findIndex(c=>c.title===n.title)),i=e.computed(()=>s.value===a.value);return(c,p)=>i.value?(e.openBlock(),e.createElementBlock("div",wr,[e.renderSlot(c.$slots,"default")])):e.createCommentVNode("",!0)}}},Symbol.toStringTag,{value:"Module"}));J.Alert=_e,J.Library=Mt,J.components=ue,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.js
CHANGED