@seresweb/website-component 2.3.0 → 2.3.2
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/_icons-B94owPWc.cjs +20 -0
- package/dist/_icons-B97SN5iK.js +25 -0
- package/dist/cjs/col.cjs +1 -1
- package/dist/cjs/date-picker.cjs +1 -1
- package/dist/cjs/date-select.cjs +1 -1
- package/dist/cjs/horizontal-viewer.cjs +1 -1
- package/dist/cjs/image-indicator.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/select.cjs +1 -1
- package/dist/cjs/swiper-normal.cjs +1 -1
- package/dist/css/col.css +1 -1
- package/dist/css/date-picker.css +1 -1
- package/dist/css/horizontal-viewer.css +1 -1
- package/dist/css/input.css +1 -1
- package/dist/css/select.css +1 -1
- package/dist/es/col.mjs +30 -21
- package/dist/es/date-picker.mjs +1 -1
- package/dist/es/date-select.mjs +25 -22
- package/dist/es/horizontal-viewer.mjs +1 -1
- package/dist/es/image-indicator.mjs +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/select.mjs +98 -98
- package/dist/es/swiper-normal.mjs +1 -1
- package/dist/{index-CEjz1ubF.cjs → index-B-0yM6xR.cjs} +1 -1
- package/dist/{index-BPX4w5Vn.js → index-BPpds5EG.js} +1 -1
- package/dist/{index-Bc4wAl0z.js → index-CMZ8zDDd.js} +1 -1
- package/dist/{index-B-sVxtkA.cjs → index-D6pYBGfZ.cjs} +1 -1
- package/dist/index.css +1 -1
- package/dist/scss/col.scss +54 -0
- package/dist/scss/date-picker.scss +1 -1
- package/dist/scss/horizontal-viewer.scss +2 -2
- package/dist/scss/input.scss +13 -0
- package/dist/scss/select.scss +12 -20
- package/dist/types/components/_icons.d.ts +2 -0
- package/dist/types/components/select/select.vue.d.ts +2 -0
- package/dist/types/components/select/type.d.ts +2 -0
- package/package.json +1 -1
- package/dist/_icons-DtBTpiO2.cjs +0 -11
- package/dist/_icons-FW35XHO0.js +0 -14
package/dist/es/select.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as F, ref as V, computed as i, onMounted as z, onUnmounted as U, createElementBlock as c, openBlock as u, normalizeClass as n, unref as l, createCommentVNode as r, createElementVNode as v, createVNode as X, renderSlot as C, createTextVNode as B, toDisplayString as b, Fragment as y, withModifiers as j, Transition as q, withCtx as A, withDirectives as G, renderList as J, vShow as K } from "vue";
|
|
2
2
|
import { P as t } from "../_vars-BV4QQF-p.js";
|
|
3
|
-
import { C as
|
|
4
|
-
const
|
|
3
|
+
import { C as Q, b as W } from "../_icons-B97SN5iK.js";
|
|
4
|
+
const Y = ["innerHTML"], Z = ["onClick"], S = /* @__PURE__ */ F({
|
|
5
5
|
name: "ScSelect",
|
|
6
6
|
__name: "select",
|
|
7
7
|
props: {
|
|
@@ -10,65 +10,73 @@ const j = ["innerHTML"], q = ["onClick"], g = /* @__PURE__ */ M({
|
|
|
10
10
|
placeholder: { default: "请选择" },
|
|
11
11
|
disabled: { type: Boolean, default: !1 },
|
|
12
12
|
dark: { type: Boolean, default: !1 },
|
|
13
|
-
clearable: { type: Boolean, default: !1 }
|
|
13
|
+
clearable: { type: Boolean, default: !1 },
|
|
14
|
+
icon: { default: void 0 },
|
|
15
|
+
iconRotate: { type: Boolean, default: !0 }
|
|
14
16
|
},
|
|
15
17
|
emits: ["update:modelValue", "change"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const e =
|
|
18
|
+
setup(f, { expose: L, emit: M }) {
|
|
19
|
+
const o = f, p = M, d = V(!1), T = Q, D = W, k = V(), m = V(!1), E = i(() => o.icon || T), $ = i(() => o.clearable && o.modelValue !== null && o.modelValue !== void 0 && o.modelValue !== "" && m.value), R = i(() => $.value ? D : E.value), N = i(() => {
|
|
20
|
+
if (o.options && o.options.length > 0) {
|
|
21
|
+
const e = o.options.find((a) => a.value === o.modelValue);
|
|
20
22
|
return e ? e.label : "";
|
|
21
23
|
}
|
|
22
24
|
return "";
|
|
23
|
-
}),
|
|
24
|
-
e
|
|
25
|
-
},
|
|
26
|
-
e
|
|
25
|
+
}), h = i(() => o.options && o.options.length > 0 ? N.value : o.modelValue === null || o.modelValue === void 0 ? "" : String(o.modelValue)), O = (e) => {
|
|
26
|
+
I(e);
|
|
27
|
+
}, I = (e) => {
|
|
28
|
+
e.preventDefault(), !o.disabled && (d.value = !d.value);
|
|
27
29
|
}, _ = (e) => {
|
|
28
|
-
e
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
e == null || e.preventDefault(), d.value = !1;
|
|
31
|
+
}, g = (e) => {
|
|
32
|
+
e.disabled || (p("update:modelValue", e.value), p("change", e.value), _());
|
|
33
|
+
}, H = () => {
|
|
34
|
+
p("update:modelValue", null), p("change", null), m.value = !1;
|
|
35
|
+
}, P = (e) => {
|
|
36
|
+
e.stopPropagation(), $.value ? H() : I(e);
|
|
37
|
+
}, w = (e) => {
|
|
38
|
+
const a = e.target;
|
|
39
|
+
k.value && !k.value.contains(a) && (d.value = !1);
|
|
34
40
|
};
|
|
35
|
-
return
|
|
36
|
-
document.addEventListener("click",
|
|
37
|
-
}),
|
|
38
|
-
document.removeEventListener("click",
|
|
39
|
-
}),
|
|
40
|
-
close:
|
|
41
|
-
selectOption:
|
|
42
|
-
}), (e,
|
|
41
|
+
return z(() => {
|
|
42
|
+
document.addEventListener("click", w);
|
|
43
|
+
}), U(() => {
|
|
44
|
+
document.removeEventListener("click", w);
|
|
45
|
+
}), L({
|
|
46
|
+
close: _,
|
|
47
|
+
selectOption: g
|
|
48
|
+
}), (e, a) => (u(), c(
|
|
43
49
|
"div",
|
|
44
50
|
{
|
|
45
51
|
ref_key: "selectRef",
|
|
46
|
-
ref:
|
|
47
|
-
class:
|
|
52
|
+
ref: k,
|
|
53
|
+
class: n([`${l(t)}-select`, { [`${l(t)}-select--dark`]: e.dark }, { [`${l(t)}-select--disabled`]: e.disabled }])
|
|
48
54
|
},
|
|
49
55
|
[
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
r(" 选择框触发区域 "),
|
|
57
|
+
v(
|
|
52
58
|
"div",
|
|
53
59
|
{
|
|
54
|
-
class:
|
|
55
|
-
onClick:
|
|
60
|
+
class: n(`${l(t)}-select__trigger`),
|
|
61
|
+
onClick: O,
|
|
62
|
+
onMouseenter: a[0] || (a[0] = (s) => m.value = !0),
|
|
63
|
+
onMouseleave: a[1] || (a[1] = (s) => m.value = !1)
|
|
56
64
|
},
|
|
57
65
|
[
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
r(" 已选择的值 "),
|
|
67
|
+
h.value ? (u(), c(
|
|
60
68
|
"div",
|
|
61
69
|
{
|
|
62
70
|
key: 0,
|
|
63
|
-
class:
|
|
71
|
+
class: n(`${l(t)}-select__value`)
|
|
64
72
|
},
|
|
65
73
|
[
|
|
66
|
-
|
|
67
|
-
value:
|
|
68
|
-
hasValue: !!
|
|
74
|
+
C(e.$slots, "selected", {
|
|
75
|
+
value: h.value,
|
|
76
|
+
hasValue: !!h.value
|
|
69
77
|
}, () => [
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
B(
|
|
79
|
+
b(h.value),
|
|
72
80
|
1
|
|
73
81
|
/* TEXT */
|
|
74
82
|
)
|
|
@@ -76,17 +84,17 @@ const j = ["innerHTML"], q = ["onClick"], g = /* @__PURE__ */ M({
|
|
|
76
84
|
],
|
|
77
85
|
2
|
|
78
86
|
/* CLASS */
|
|
79
|
-
)) : (
|
|
80
|
-
|
|
87
|
+
)) : (u(), c(
|
|
88
|
+
y,
|
|
81
89
|
{ key: 1 },
|
|
82
90
|
[
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
r(" placeholder "),
|
|
92
|
+
v(
|
|
85
93
|
"div",
|
|
86
94
|
{
|
|
87
|
-
class:
|
|
95
|
+
class: n(`${l(t)}-select__placeholder`)
|
|
88
96
|
},
|
|
89
|
-
|
|
97
|
+
b(e.placeholder),
|
|
90
98
|
3
|
|
91
99
|
/* TEXT, CLASS */
|
|
92
100
|
)
|
|
@@ -94,90 +102,82 @@ const j = ["innerHTML"], q = ["onClick"], g = /* @__PURE__ */ M({
|
|
|
94
102
|
2112
|
|
95
103
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
96
104
|
)),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
/* CLASS */
|
|
108
|
-
)) : o("v-if", !0),
|
|
109
|
-
o(" 下拉箭头 "),
|
|
110
|
-
r("div", {
|
|
111
|
-
class: a([`${l(t)}-select__icon`, { [`${l(t)}-select__icon--open`]: d.value }]),
|
|
112
|
-
innerHTML: l(B),
|
|
113
|
-
"aria-hidden": "true"
|
|
114
|
-
}, null, 10, j)
|
|
105
|
+
r(" 下拉箭头/清除按钮 "),
|
|
106
|
+
v("div", {
|
|
107
|
+
class: n([
|
|
108
|
+
`${l(t)}-select__icon`,
|
|
109
|
+
{ [`${l(t)}-select__icon--open`]: d.value && !$.value && e.iconRotate },
|
|
110
|
+
{ [`${l(t)}-select__icon--clear`]: $.value }
|
|
111
|
+
]),
|
|
112
|
+
innerHTML: R.value,
|
|
113
|
+
onClick: j(P, ["stop"])
|
|
114
|
+
}, null, 10, Y)
|
|
115
115
|
],
|
|
116
|
-
|
|
117
|
-
/* CLASS */
|
|
116
|
+
34
|
|
117
|
+
/* CLASS, NEED_HYDRATION */
|
|
118
118
|
),
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
r(" 下拉菜单 "),
|
|
120
|
+
X(q, {
|
|
121
121
|
name: `${l(t)}-select-slide`,
|
|
122
122
|
persisted: ""
|
|
123
123
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
|
|
124
|
+
default: A(() => [
|
|
125
|
+
G(v(
|
|
126
126
|
"div",
|
|
127
127
|
{
|
|
128
|
-
class:
|
|
128
|
+
class: n(`${l(t)}-select__dropdown`)
|
|
129
129
|
},
|
|
130
130
|
[
|
|
131
|
-
|
|
132
|
-
e.options && e.options.length > 0 && !e.$slots.default ? (
|
|
131
|
+
r(" 默认选项列表 "),
|
|
132
|
+
e.options && e.options.length > 0 && !e.$slots.default ? (u(), c(
|
|
133
133
|
"div",
|
|
134
134
|
{
|
|
135
135
|
key: 0,
|
|
136
|
-
class:
|
|
136
|
+
class: n(`${l(t)}-select__options`)
|
|
137
137
|
},
|
|
138
138
|
[
|
|
139
|
-
(
|
|
140
|
-
|
|
139
|
+
(u(!0), c(
|
|
140
|
+
y,
|
|
141
141
|
null,
|
|
142
|
-
|
|
143
|
-
key: `${
|
|
144
|
-
class:
|
|
142
|
+
J(e.options, (s) => (u(), c("div", {
|
|
143
|
+
key: `${s.value}`,
|
|
144
|
+
class: n([
|
|
145
145
|
`${l(t)}-select__option`,
|
|
146
146
|
{
|
|
147
|
-
[`${l(t)}-select__option--selected`]: e.modelValue ===
|
|
148
|
-
[`${l(t)}-select__option--disabled`]:
|
|
147
|
+
[`${l(t)}-select__option--selected`]: e.modelValue === s.value,
|
|
148
|
+
[`${l(t)}-select__option--disabled`]: s.disabled
|
|
149
149
|
}
|
|
150
150
|
]),
|
|
151
|
-
onClick: (
|
|
151
|
+
onClick: (x) => g(s)
|
|
152
152
|
}, [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
C(e.$slots, "option", { option: s }, () => [
|
|
154
|
+
B(
|
|
155
|
+
b(s.label),
|
|
156
156
|
1
|
|
157
157
|
/* TEXT */
|
|
158
158
|
)
|
|
159
159
|
])
|
|
160
|
-
], 10,
|
|
160
|
+
], 10, Z))),
|
|
161
161
|
128
|
|
162
162
|
/* KEYED_FRAGMENT */
|
|
163
163
|
))
|
|
164
164
|
],
|
|
165
165
|
2
|
|
166
166
|
/* CLASS */
|
|
167
|
-
)) : (
|
|
168
|
-
|
|
167
|
+
)) : (u(), c(
|
|
168
|
+
y,
|
|
169
169
|
{ key: 1 },
|
|
170
170
|
[
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
r(" 自定义内容插槽 "),
|
|
172
|
+
v(
|
|
173
173
|
"div",
|
|
174
174
|
{
|
|
175
|
-
class:
|
|
175
|
+
class: n(`${l(t)}-select__custom-content`)
|
|
176
176
|
},
|
|
177
177
|
[
|
|
178
|
-
|
|
179
|
-
select:
|
|
180
|
-
close:
|
|
178
|
+
C(e.$slots, "default", {
|
|
179
|
+
select: g,
|
|
180
|
+
close: _
|
|
181
181
|
})
|
|
182
182
|
],
|
|
183
183
|
2
|
|
@@ -191,7 +191,7 @@ const j = ["innerHTML"], q = ["onClick"], g = /* @__PURE__ */ M({
|
|
|
191
191
|
2
|
|
192
192
|
/* CLASS */
|
|
193
193
|
), [
|
|
194
|
-
[
|
|
194
|
+
[K, d.value]
|
|
195
195
|
])
|
|
196
196
|
]),
|
|
197
197
|
_: 3
|
|
@@ -203,8 +203,8 @@ const j = ["innerHTML"], q = ["onClick"], g = /* @__PURE__ */ M({
|
|
|
203
203
|
));
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
|
-
|
|
207
|
-
const
|
|
206
|
+
S.install = (f) => (f.component("ScSelect", S), f);
|
|
207
|
+
const oe = S;
|
|
208
208
|
export {
|
|
209
|
-
|
|
209
|
+
oe as ScSelect
|
|
210
210
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),H=require("./swiper-bundle-gkukcY4l.cjs"),n=require("./_vars-CyrPevgT.cjs");require("./cjs/accordion-info-panel.cjs");require("./cjs/animated-number.cjs");require("./cjs/checkbox.cjs");require("./cjs/col.cjs");require("./cjs/config-provider.cjs");require("./index-B-sVxtkA.cjs");require("./cjs/date-select.cjs");require("./cjs/drawer.cjs");require("./cjs/dropdown.cjs");require("./cjs/gradual-highlight.cjs");const X=require("@vavt/util");require("./cjs/input.cjs");const V=require("./cjs/layz-image.cjs");require("./cjs/parameter-box.cjs");require("./cjs/radio.cjs");require("./cjs/row.cjs");require("./cjs/select.cjs");require("./cjs/swiper-showcase.cjs");require("./cjs/swiper-vehicle.cjs");const q=require("./cjs/tab-indicator.cjs"),$=require("./cjs/video.cjs"),W=["innerHTML"],O=["innerHTML"],U=["innerHTML"],D=["innerHTML"],A=e.defineComponent({__name:"pc-viewer",props:{title:{},desc:{},dataList:{},extraTopSpacing:{default:0},extraBottomSpacing:{default:0}},setup(l){const p=l,a=e.ref(),v=e.ref(),o=e.ref(),d=e.ref(),f=e.ref(),i=e.ref(),h=e.reactive({container:"",root:"",item:""}),u=r=>typeof r!="number"||Number.isNaN(r)?0:r,g=(r,s,c)=>{const k=Math.min(Math.max(r,0),c),_=Math.min(Math.max(s,0),Math.max(c-k,0));return{safeTop:k,safeBottom:_}},B=()=>{var b;if(!o.value)return;const r=o.value.offsetHeight,s=window.innerHeight,c=((b=i.value)==null?void 0:b.offsetHeight)||0,k=m(i.value),_=u(p.extraTopSpacing),E=u(p.extraBottomSpacing),{safeTop:I,safeBottom:L}=g(_,E,s),C=Math.max(s-I-L,0),z=Math.max((C-c-r-k)/2,0),M=I+z,N=L+z;h.container=`padding-top: ${M}px; padding-bottom: ${N}px; min-height: ${s}px;`;const x=o.value.scrollWidth;h.root=`height: ${Math.max(x,s)}px`},t=()=>{const r=document.documentElement.getAttribute("dir")||"ltr",s=r==="rtl"?"right":"left";if(!a.value||!o.value||!d.value||!f.value)return;const k=a.value.clientHeight-window.innerHeight,{offsetTop:_}=X.getRootOffset(a.value),E=document.documentElement.scrollTop-_;if(E<0){o.value.scrollTo({left:0}),f.value.style[s]="0px";return}if(E>k){const z=o.value.scrollWidth-window.innerWidth;o.value.scrollTo({left:r==="rtl"?-z:z}),f.value.style[s]=d.value.clientWidth-f.value.clientWidth+"px";return}const I=E/k,L=I*(o.value.scrollWidth-window.innerWidth),C=I*(d.value.clientWidth*2/3);o.value.scrollTo({left:r==="rtl"?-L:L}),f.value.style[s]=`${C}px`},w=()=>{h.container="",B()},m=r=>{if(!(r instanceof HTMLElement))return 0;const s=window.getComputedStyle(r),c=parseFloat(s.marginTop)||0,k=parseFloat(s.marginBottom)||0;return c+k};let y;return e.watch(()=>[p.extraTopSpacing,p.extraBottomSpacing],()=>{h.container="",B()}),e.onMounted(()=>{y=new IntersectionObserver(r=>{r.forEach(s=>{s.isIntersecting&&(h.container="",B())})},{root:null,rootMargin:"200px 0px 200px 0px",threshold:0}),window.addEventListener("scroll",t),window.addEventListener("resize",w),a.value&&y.observe(a.value)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",w),y&&y.disconnect()}),(r,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer`),style:e.normalizeStyle(h.root)},[e.createElementVNode("div",{ref_key:"containerRef",ref:v,class:e.normalizeClass([`${e.unref(n.PREFIX)}-horizontal-viewer__container`,(r.title||r.desc)&&"has-header"]),style:e.normalizeStyle(h.container)},[r.title||r.desc?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__header`),ref_key:"headerRef",ref:i},[r.title?(e.openBlock(),e.createElementBlock("p",{key:0,innerHTML:r.title},null,8,W)):e.createCommentVNode("v-if",!0),r.desc?(e.openBlock(),e.createElementBlock("p",{key:1,innerHTML:r.desc},null,8,O)):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"scrollerRef",ref:o,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__scroller`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__content`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataList,c=>(e.openBlock(),e.createElementBlock("div",{key:c.title,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__content-item`)},[c.type==="img"?(e.openBlock(),e.createBlock(e.unref(V.ScLayzImage),{key:0,src:c.url,alt:c.alt},null,8,["src","alt"])):(e.openBlock(),e.createBlock(e.unref($.ScVideo),{key:1,url:c.url,poster:c.poster,"auto-play":!1},null,8,["url","poster"])),e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__content-item-footer`)},[e.createElementVNode("p",{innerHTML:c.title},null,8,U),e.createElementVNode("p",{innerHTML:c.desc},null,8,D)],2)],2))),128))],2)],2),e.createElementVNode("div",{ref_key:"paginationRef",ref:d,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__pagination`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__scrollbar`)},[e.createElementVNode("div",{ref_key:"scrollbarDragRef",ref:f,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__scrollbar-drag`)},null,2)],2)],2)],6)],6))}}),Y=e.defineComponent({__name:"mb-viewer",props:{title:{},desc:{},isMobile:{type:Boolean},extraTopSpacing:{},extraBottomSpacing:{},modelValue:{},dataList:{},swiperOptions:{},effect:{},showIntro:{type:Boolean},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{},indicatorType:{},showIndicator:{type:Boolean},indicatorPosition:{}},setup(l){const p=l,a=e.ref();return(v,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer-mb`)},[e.createVNode(e.unref(F),e.mergeProps(p,{indicatorType:"image"}),null,16)],2))}}),R=e.defineComponent({__name:"horizontal-viewer",props:{title:{},desc:{},isMobile:{type:Boolean},extraTopSpacing:{},extraBottomSpacing:{},modelValue:{},dataList:{},swiperOptions:{},effect:{},showIntro:{type:Boolean},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{},indicatorType:{},showIndicator:{type:Boolean,default:!0},indicatorPosition:{}},setup(l){const p=l;return(a,v)=>a.isMobile?(e.openBlock(),e.createBlock(Y,e.normalizeProps(e.mergeProps({key:0},p)),null,16)):(e.openBlock(),e.createBlock(A,e.normalizeProps(e.mergeProps({key:1},p)),null,16))}});R.install=l=>(l.component("ScHorizontalViewer",R),l);const Z=R,j=["onClick"],G=["innerHTML"],J=["innerHTML"],P=e.defineComponent({__name:"image-indicator",props:{dataList:{},showIntro:{type:Boolean,default:!0}},emits:["change"],setup(l,{emit:p}){const a=p,v=e.ref(0),o=e.ref([]),d=e.computed(()=>{const i=o.value[v.value];return{height:`${i==null?void 0:i.offsetHeight}px`}}),f=i=>{v.value=i,a("change",i)};return(i,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__list`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:u.url,class:e.normalizeClass([`${e.unref(n.PREFIX)}-image-indicator__list-item`,v.value===g?`${e.unref(n.PREFIX)}-image-indicator__active`:""]),onClick:B=>f(g)},[e.createVNode(e.unref(V.ScLayzImage),{src:u.url,alt:u.alt},null,8,["src","alt"])],10,j))),128))],2),i.showIntro?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__intro`),style:e.normalizeStyle(d.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:u.url,ref_for:!0,ref_key:"introItemRef",ref:o,class:e.normalizeClass([`${e.unref(n.PREFIX)}-image-indicator__intro-item`,v.value===g&&`${e.unref(n.PREFIX)}-image-indicator__active`])},[u.title?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__intro-title`),innerHTML:u.title},null,10,G)):e.createCommentVNode("v-if",!0),u.desc?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__intro-desc`),innerHTML:u.desc},null,10,J)):e.createCommentVNode("v-if",!0)],2))),128))],6)):e.createCommentVNode("v-if",!0)],2))}});P.install=l=>(l.component("ScImageIndicator",P),l);const T=P,K={class:"swiper-wrapper"},S=e.defineComponent({__name:"swiper-normal",props:{modelValue:{default:0},dataList:{},swiperOptions:{default:()=>({})},effect:{},showIntro:{type:Boolean,default:!0},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{default:"full"},indicatorType:{default:"tab"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{default:"relative"}},emits:["change","update:modelValue"],setup(l,{emit:p}){const a=l,v=p;let o=null;const d=e.ref(a.modelValue),f=e.ref(),i=e.computed(()=>{const t=[`${n.PREFIX}-swiper-main`];return a.widthType==="middle"?t.push(`${n.PREFIX}-swiper-main__middle`):t.push(`${n.PREFIX}-swiper-main__full`),t}),h=e.computed(()=>{const t={};return a.tabIndicatorBottom&&(t.position="absolute",t.zIndex=1,t.bottom=typeof a.tabIndicatorBottom=="number"?`${a.tabIndicatorBottom}px`:a.tabIndicatorBottom),t});e.watch(()=>a.modelValue,()=>{d.value=a.modelValue,g(d.value)});const u=e.computed(()=>a.dataList.map(t=>({...t,url:t.type==="img"?t.url||"":t.poster||""}))),g=t=>{o==null||o.slideTo(t)},B=()=>{o==null||o.destroy(),f.value&&(o=new H.Swiper(f.value,{slidesPerView:1,allowTouchMove:!1,effect:a.effect,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},...a.swiperOptions}),o.on("slideChange",t=>{d.value=t.activeIndex,v("change",t.activeIndex),v("update:modelValue",t.activeIndex)}))};return e.onMounted(()=>{B(),window.addEventListener("resize",B)}),e.onBeforeUnmount(()=>{o==null||o.destroy(),window.removeEventListener("resize",B)}),(t,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-swiper`)},[e.createElementVNode("div",{ref_key:"swiperRef",ref:f,class:e.normalizeClass(i.value)},[e.createElementVNode("div",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataList,(m,y)=>(e.openBlock(),e.createElementBlock("div",{key:m.title,class:"swiper-slide"},[m.type==="img"?(e.openBlock(),e.createBlock(e.unref(V.ScLayzImage),{key:0,src:m.url,alt:m.alt},null,8,["src","alt"])):(e.openBlock(),e.createBlock(e.unref($.ScVideo),e.mergeProps({key:1,ref_for:!0},t.videoProps,{url:m.url,poster:m.poster,playable:d.value===y}),null,16,["url","poster","playable"])),m.mask?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(`${e.unref(n.PREFIX)}-swiper-mask`)},null,2)):e.createCommentVNode("v-if",!0)]))),128))]),w[2]||(w[2]=e.createStaticVNode('<div class="swiper-button-next"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none"><path d="M9.64299 3.12871L9.51887 5.83301L15.6859 12L9.51887 18.167L9.64299 20.8713L18.5143 12L9.64299 3.12871Z" fill="white"></path></svg></div><div class="swiper-button-prev"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M15.1289 3.12871L15.2531 5.83301L9.08609 12L15.2531 18.167L15.1289 20.8713L6.25766 12L15.1289 3.12871Z" fill="white"></path></svg></div>',2))],2),t.showIndicator?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.indicatorType==="tab"?(e.openBlock(),e.createBlock(e.unref(q.ScTabIndicator),{key:0,modelValue:d.value,"onUpdate:modelValue":w[0]||(w[0]=m=>d.value=m),class:e.normalizeClass([t.indicatorClass,t.indicatorPosition==="absolute"&&`${e.unref(n.PREFIX)}-swiper-indicator-absolute`]),dataList:t.dataList,"show-intro":t.showIntro,style:e.normalizeStyle(h.value),onChange:g},null,8,["modelValue","class","dataList","show-intro","style"])):(e.openBlock(),e.createBlock(e.unref(T),{key:1,modelValue:d.value,"onUpdate:modelValue":w[1]||(w[1]=m=>d.value=m),dataList:u.value,onChange:g},null,8,["modelValue","dataList"]))],64)):e.createCommentVNode("v-if",!0)],2))}});S.install=l=>(l.component("ScSwiperNormal",S),l);const F=S;exports.ScHorizontalViewer=Z;exports.ScImageIndicator=T;exports.ScSwiperNormal=F;
|
|
1
|
+
"use strict";const e=require("vue"),H=require("./swiper-bundle-gkukcY4l.cjs"),n=require("./_vars-CyrPevgT.cjs");require("./cjs/accordion-info-panel.cjs");require("./cjs/animated-number.cjs");require("./cjs/checkbox.cjs");require("./cjs/col.cjs");require("./cjs/config-provider.cjs");require("./index-D6pYBGfZ.cjs");require("./cjs/date-select.cjs");require("./cjs/drawer.cjs");require("./cjs/dropdown.cjs");require("./cjs/gradual-highlight.cjs");const X=require("@vavt/util");require("./cjs/input.cjs");const V=require("./cjs/layz-image.cjs");require("./cjs/parameter-box.cjs");require("./cjs/radio.cjs");require("./cjs/row.cjs");require("./cjs/select.cjs");require("./cjs/swiper-showcase.cjs");require("./cjs/swiper-vehicle.cjs");const q=require("./cjs/tab-indicator.cjs"),$=require("./cjs/video.cjs"),W=["innerHTML"],O=["innerHTML"],U=["innerHTML"],D=["innerHTML"],A=e.defineComponent({__name:"pc-viewer",props:{title:{},desc:{},dataList:{},extraTopSpacing:{default:0},extraBottomSpacing:{default:0}},setup(l){const p=l,a=e.ref(),v=e.ref(),o=e.ref(),d=e.ref(),f=e.ref(),i=e.ref(),h=e.reactive({container:"",root:"",item:""}),u=r=>typeof r!="number"||Number.isNaN(r)?0:r,g=(r,s,c)=>{const k=Math.min(Math.max(r,0),c),_=Math.min(Math.max(s,0),Math.max(c-k,0));return{safeTop:k,safeBottom:_}},B=()=>{var b;if(!o.value)return;const r=o.value.offsetHeight,s=window.innerHeight,c=((b=i.value)==null?void 0:b.offsetHeight)||0,k=m(i.value),_=u(p.extraTopSpacing),E=u(p.extraBottomSpacing),{safeTop:I,safeBottom:L}=g(_,E,s),C=Math.max(s-I-L,0),z=Math.max((C-c-r-k)/2,0),M=I+z,N=L+z;h.container=`padding-top: ${M}px; padding-bottom: ${N}px; min-height: ${s}px;`;const x=o.value.scrollWidth;h.root=`height: ${Math.max(x,s)}px`},t=()=>{const r=document.documentElement.getAttribute("dir")||"ltr",s=r==="rtl"?"right":"left";if(!a.value||!o.value||!d.value||!f.value)return;const k=a.value.clientHeight-window.innerHeight,{offsetTop:_}=X.getRootOffset(a.value),E=document.documentElement.scrollTop-_;if(E<0){o.value.scrollTo({left:0}),f.value.style[s]="0px";return}if(E>k){const z=o.value.scrollWidth-window.innerWidth;o.value.scrollTo({left:r==="rtl"?-z:z}),f.value.style[s]=d.value.clientWidth-f.value.clientWidth+"px";return}const I=E/k,L=I*(o.value.scrollWidth-window.innerWidth),C=I*(d.value.clientWidth*2/3);o.value.scrollTo({left:r==="rtl"?-L:L}),f.value.style[s]=`${C}px`},w=()=>{h.container="",B()},m=r=>{if(!(r instanceof HTMLElement))return 0;const s=window.getComputedStyle(r),c=parseFloat(s.marginTop)||0,k=parseFloat(s.marginBottom)||0;return c+k};let y;return e.watch(()=>[p.extraTopSpacing,p.extraBottomSpacing],()=>{h.container="",B()}),e.onMounted(()=>{y=new IntersectionObserver(r=>{r.forEach(s=>{s.isIntersecting&&(h.container="",B())})},{root:null,rootMargin:"200px 0px 200px 0px",threshold:0}),window.addEventListener("scroll",t),window.addEventListener("resize",w),a.value&&y.observe(a.value)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",w),y&&y.disconnect()}),(r,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer`),style:e.normalizeStyle(h.root)},[e.createElementVNode("div",{ref_key:"containerRef",ref:v,class:e.normalizeClass([`${e.unref(n.PREFIX)}-horizontal-viewer__container`,(r.title||r.desc)&&"has-header"]),style:e.normalizeStyle(h.container)},[r.title||r.desc?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__header`),ref_key:"headerRef",ref:i},[r.title?(e.openBlock(),e.createElementBlock("p",{key:0,innerHTML:r.title},null,8,W)):e.createCommentVNode("v-if",!0),r.desc?(e.openBlock(),e.createElementBlock("p",{key:1,innerHTML:r.desc},null,8,O)):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"scrollerRef",ref:o,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__scroller`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__content`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.dataList,c=>(e.openBlock(),e.createElementBlock("div",{key:c.title,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__content-item`)},[c.type==="img"?(e.openBlock(),e.createBlock(e.unref(V.ScLayzImage),{key:0,src:c.url,alt:c.alt},null,8,["src","alt"])):(e.openBlock(),e.createBlock(e.unref($.ScVideo),{key:1,url:c.url,poster:c.poster,"auto-play":!1},null,8,["url","poster"])),e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__content-item-footer`)},[e.createElementVNode("p",{innerHTML:c.title},null,8,U),e.createElementVNode("p",{innerHTML:c.desc},null,8,D)],2)],2))),128))],2)],2),e.createElementVNode("div",{ref_key:"paginationRef",ref:d,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__pagination`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__scrollbar`)},[e.createElementVNode("div",{ref_key:"scrollbarDragRef",ref:f,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer__scrollbar-drag`)},null,2)],2)],2)],6)],6))}}),Y=e.defineComponent({__name:"mb-viewer",props:{title:{},desc:{},isMobile:{type:Boolean},extraTopSpacing:{},extraBottomSpacing:{},modelValue:{},dataList:{},swiperOptions:{},effect:{},showIntro:{type:Boolean},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{},indicatorType:{},showIndicator:{type:Boolean},indicatorPosition:{}},setup(l){const p=l,a=e.ref();return(v,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass(`${e.unref(n.PREFIX)}-horizontal-viewer-mb`)},[e.createVNode(e.unref(F),e.mergeProps(p,{indicatorType:"image"}),null,16)],2))}}),R=e.defineComponent({__name:"horizontal-viewer",props:{title:{},desc:{},isMobile:{type:Boolean},extraTopSpacing:{},extraBottomSpacing:{},modelValue:{},dataList:{},swiperOptions:{},effect:{},showIntro:{type:Boolean},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{},indicatorType:{},showIndicator:{type:Boolean,default:!0},indicatorPosition:{}},setup(l){const p=l;return(a,v)=>a.isMobile?(e.openBlock(),e.createBlock(Y,e.normalizeProps(e.mergeProps({key:0},p)),null,16)):(e.openBlock(),e.createBlock(A,e.normalizeProps(e.mergeProps({key:1},p)),null,16))}});R.install=l=>(l.component("ScHorizontalViewer",R),l);const Z=R,j=["onClick"],G=["innerHTML"],J=["innerHTML"],P=e.defineComponent({__name:"image-indicator",props:{dataList:{},showIntro:{type:Boolean,default:!0}},emits:["change"],setup(l,{emit:p}){const a=p,v=e.ref(0),o=e.ref([]),d=e.computed(()=>{const i=o.value[v.value];return{height:`${i==null?void 0:i.offsetHeight}px`}}),f=i=>{v.value=i,a("change",i)};return(i,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator`)},[e.createElementVNode("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__list`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:u.url,class:e.normalizeClass([`${e.unref(n.PREFIX)}-image-indicator__list-item`,v.value===g?`${e.unref(n.PREFIX)}-image-indicator__active`:""]),onClick:B=>f(g)},[e.createVNode(e.unref(V.ScLayzImage),{src:u.url,alt:u.alt},null,8,["src","alt"])],10,j))),128))],2),i.showIntro?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__intro`),style:e.normalizeStyle(d.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.dataList,(u,g)=>(e.openBlock(),e.createElementBlock("div",{key:u.url,ref_for:!0,ref_key:"introItemRef",ref:o,class:e.normalizeClass([`${e.unref(n.PREFIX)}-image-indicator__intro-item`,v.value===g&&`${e.unref(n.PREFIX)}-image-indicator__active`])},[u.title?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__intro-title`),innerHTML:u.title},null,10,G)):e.createCommentVNode("v-if",!0),u.desc?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(`${e.unref(n.PREFIX)}-image-indicator__intro-desc`),innerHTML:u.desc},null,10,J)):e.createCommentVNode("v-if",!0)],2))),128))],6)):e.createCommentVNode("v-if",!0)],2))}});P.install=l=>(l.component("ScImageIndicator",P),l);const T=P,K={class:"swiper-wrapper"},S=e.defineComponent({__name:"swiper-normal",props:{modelValue:{default:0},dataList:{},swiperOptions:{default:()=>({})},effect:{},showIntro:{type:Boolean,default:!0},videoProps:{},indicatorClass:{},tabIndicatorBottom:{},widthType:{default:"full"},indicatorType:{default:"tab"},showIndicator:{type:Boolean,default:!0},indicatorPosition:{default:"relative"}},emits:["change","update:modelValue"],setup(l,{emit:p}){const a=l,v=p;let o=null;const d=e.ref(a.modelValue),f=e.ref(),i=e.computed(()=>{const t=[`${n.PREFIX}-swiper-main`];return a.widthType==="middle"?t.push(`${n.PREFIX}-swiper-main__middle`):t.push(`${n.PREFIX}-swiper-main__full`),t}),h=e.computed(()=>{const t={};return a.tabIndicatorBottom&&(t.position="absolute",t.zIndex=1,t.bottom=typeof a.tabIndicatorBottom=="number"?`${a.tabIndicatorBottom}px`:a.tabIndicatorBottom),t});e.watch(()=>a.modelValue,()=>{d.value=a.modelValue,g(d.value)});const u=e.computed(()=>a.dataList.map(t=>({...t,url:t.type==="img"?t.url||"":t.poster||""}))),g=t=>{o==null||o.slideTo(t)},B=()=>{o==null||o.destroy(),f.value&&(o=new H.Swiper(f.value,{slidesPerView:1,allowTouchMove:!1,effect:a.effect,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},...a.swiperOptions}),o.on("slideChange",t=>{d.value=t.activeIndex,v("change",t.activeIndex),v("update:modelValue",t.activeIndex)}))};return e.onMounted(()=>{B(),window.addEventListener("resize",B)}),e.onBeforeUnmount(()=>{o==null||o.destroy(),window.removeEventListener("resize",B)}),(t,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`${e.unref(n.PREFIX)}-swiper`)},[e.createElementVNode("div",{ref_key:"swiperRef",ref:f,class:e.normalizeClass(i.value)},[e.createElementVNode("div",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataList,(m,y)=>(e.openBlock(),e.createElementBlock("div",{key:m.title,class:"swiper-slide"},[m.type==="img"?(e.openBlock(),e.createBlock(e.unref(V.ScLayzImage),{key:0,src:m.url,alt:m.alt},null,8,["src","alt"])):(e.openBlock(),e.createBlock(e.unref($.ScVideo),e.mergeProps({key:1,ref_for:!0},t.videoProps,{url:m.url,poster:m.poster,playable:d.value===y}),null,16,["url","poster","playable"])),m.mask?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(`${e.unref(n.PREFIX)}-swiper-mask`)},null,2)):e.createCommentVNode("v-if",!0)]))),128))]),w[2]||(w[2]=e.createStaticVNode('<div class="swiper-button-next"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none"><path d="M9.64299 3.12871L9.51887 5.83301L15.6859 12L9.51887 18.167L9.64299 20.8713L18.5143 12L9.64299 3.12871Z" fill="white"></path></svg></div><div class="swiper-button-prev"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M15.1289 3.12871L15.2531 5.83301L9.08609 12L15.2531 18.167L15.1289 20.8713L6.25766 12L15.1289 3.12871Z" fill="white"></path></svg></div>',2))],2),t.showIndicator?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.indicatorType==="tab"?(e.openBlock(),e.createBlock(e.unref(q.ScTabIndicator),{key:0,modelValue:d.value,"onUpdate:modelValue":w[0]||(w[0]=m=>d.value=m),class:e.normalizeClass([t.indicatorClass,t.indicatorPosition==="absolute"&&`${e.unref(n.PREFIX)}-swiper-indicator-absolute`]),dataList:t.dataList,"show-intro":t.showIntro,style:e.normalizeStyle(h.value),onChange:g},null,8,["modelValue","class","dataList","show-intro","style"])):(e.openBlock(),e.createBlock(e.unref(T),{key:1,modelValue:d.value,"onUpdate:modelValue":w[1]||(w[1]=m=>d.value=m),dataList:u.value,onChange:g},null,8,["modelValue","dataList"]))],64)):e.createCommentVNode("v-if",!0)],2))}});S.install=l=>(l.component("ScSwiperNormal",S),l);const F=S;exports.ScHorizontalViewer=Z;exports.ScImageIndicator=T;exports.ScSwiperNormal=F;
|
|
@@ -6,7 +6,7 @@ import "./es/animated-number.mjs";
|
|
|
6
6
|
import "./es/checkbox.mjs";
|
|
7
7
|
import "./es/col.mjs";
|
|
8
8
|
import "./es/config-provider.mjs";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-CMZ8zDDd.js";
|
|
10
10
|
import "./es/date-select.mjs";
|
|
11
11
|
import "./es/drawer.mjs";
|
|
12
12
|
import "./es/dropdown.mjs";
|
|
@@ -2,7 +2,7 @@ import { w as Mt } from "./_utils-B7LThWoT.js";
|
|
|
2
2
|
import { defineComponent as _t, inject as gt, ref as ht, computed as mt, watch as kt, createElementBlock as tt, openBlock as et, normalizeClass as Z, unref as g, createElementVNode as q, toDisplayString as at, Fragment as $t, renderList as pt } from "vue";
|
|
3
3
|
import { P as b } from "./_vars-BV4QQF-p.js";
|
|
4
4
|
import { e as wt } from "./en-US-BBTWftdk.js";
|
|
5
|
-
import { C as St } from "./_icons-
|
|
5
|
+
import { C as St } from "./_icons-B97SN5iK.js";
|
|
6
6
|
function yt(E) {
|
|
7
7
|
return E && E.__esModule && Object.prototype.hasOwnProperty.call(E, "default") ? E.default : E;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const de=require("./_utils-CtkVBTg-.cjs"),r=require("vue"),b=require("./_vars-CyrPevgT.cjs"),fe=require("./en-US-UkqgG0fb.cjs"),he=require("./_icons-DtBTpiO2.cjs");function le(z){return z&&z.__esModule&&Object.prototype.hasOwnProperty.call(z,"default")?z.default:z}var ee={exports:{}},me=ee.exports,ue;function pe(){return ue||(ue=1,(function(z,ne){(function(B,g){z.exports=g()})(me,(function(){var B=1e3,g=6e4,W=36e5,H="millisecond",$="second",y="minute",S="hour",F="day",k="week",w="month",Z="quarter",I="year",X="date",f="Invalid Date",a=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(i){var t=["th","st","nd","rd"],e=i%100;return"["+i+(t[(e-20)%10]||t[e]||t[0])+"]"}},v=function(i,t,e){var s=String(i);return!s||s.length>=t?i:""+Array(t+1-s.length).join(e)+i},P={s:v,z:function(i){var t=-i.utcOffset(),e=Math.abs(t),s=Math.floor(e/60),n=e%60;return(t<=0?"+":"-")+v(s,2,"0")+":"+v(n,2,"0")},m:function i(t,e){if(t.date()<e.date())return-i(e,t);var s=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(s,w),u=e-n<0,c=t.clone().add(s+(u?-1:1),w);return+(-(s+(e-n)/(u?n-c:c-n))||0)},a:function(i){return i<0?Math.ceil(i)||0:Math.floor(i)},p:function(i){return{M:w,y:I,w:k,d:F,D:X,h:S,m:y,s:$,ms:H,Q:Z}[i]||String(i||"").toLowerCase().replace(/s$/,"")},u:function(i){return i===void 0}},E="en",x={};x[E]=p;var R="$isDayjsObject",m=function(i){return i instanceof L||!(!i||!i[R])},D=function i(t,e,s){var n;if(!t)return E;if(typeof t=="string"){var u=t.toLowerCase();x[u]&&(n=u),e&&(x[u]=e,n=u);var c=t.split("-");if(!n&&c.length>1)return i(c[0])}else{var d=t.name;x[d]=t,n=d}return!s&&n&&(E=n),n||!s&&E},h=function(i,t){if(m(i))return i.clone();var e=typeof t=="object"?t:{};return e.date=i,e.args=arguments,new L(e)},l=P;l.l=D,l.i=m,l.w=function(i,t){return h(i,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var L=(function(){function i(e){this.$L=D(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[R]=!0}var t=i.prototype;return t.parse=function(e){this.$d=(function(s){var n=s.date,u=s.utc;if(n===null)return new Date(NaN);if(l.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var c=n.match(a);if(c){var d=c[2]-1||0,M=(c[7]||"0").substring(0,3);return u?new Date(Date.UTC(c[1],d,c[3]||1,c[4]||0,c[5]||0,c[6]||0,M)):new Date(c[1],d,c[3]||1,c[4]||0,c[5]||0,c[6]||0,M)}}return new Date(n)})(e),this.init()},t.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},t.$utils=function(){return l},t.isValid=function(){return this.$d.toString()!==f},t.isSame=function(e,s){var n=h(e);return this.startOf(s)<=n&&n<=this.endOf(s)},t.isAfter=function(e,s){return h(e)<this.startOf(s)},t.isBefore=function(e,s){return this.endOf(s)<h(e)},t.$g=function(e,s,n){return l.u(e)?this[s]:this.set(n,e)},t.unix=function(){return Math.floor(this.valueOf()/1e3)},t.valueOf=function(){return this.$d.getTime()},t.startOf=function(e,s){var n=this,u=!!l.u(s)||s,c=l.p(e),d=function(A,O){var V=l.w(n.$u?Date.UTC(n.$y,O,A):new Date(n.$y,O,A),n);return u?V:V.endOf(F)},M=function(A,O){return l.w(n.toDate()[A].apply(n.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(O)),n)},_=this.$W,Y=this.$M,T=this.$D,q="set"+(this.$u?"UTC":"");switch(c){case I:return u?d(1,0):d(31,11);case w:return u?d(1,Y):d(0,Y+1);case k:var N=this.$locale().weekStart||0,Q=(_<N?_+7:_)-N;return d(u?T-Q:T+(6-Q),Y);case F:case X:return M(q+"Hours",0);case S:return M(q+"Minutes",1);case y:return M(q+"Seconds",2);case $:return M(q+"Milliseconds",3);default:return this.clone()}},t.endOf=function(e){return this.startOf(e,!1)},t.$set=function(e,s){var n,u=l.p(e),c="set"+(this.$u?"UTC":""),d=(n={},n[F]=c+"Date",n[X]=c+"Date",n[w]=c+"Month",n[I]=c+"FullYear",n[S]=c+"Hours",n[y]=c+"Minutes",n[$]=c+"Seconds",n[H]=c+"Milliseconds",n)[u],M=u===F?this.$D+(s-this.$W):s;if(u===w||u===I){var _=this.clone().set(X,1);_.$d[d](M),_.init(),this.$d=_.set(X,Math.min(this.$D,_.daysInMonth())).$d}else d&&this.$d[d](M);return this.init(),this},t.set=function(e,s){return this.clone().$set(e,s)},t.get=function(e){return this[l.p(e)]()},t.add=function(e,s){var n,u=this;e=Number(e);var c=l.p(s),d=function(Y){var T=h(u);return l.w(T.date(T.date()+Math.round(Y*e)),u)};if(c===w)return this.set(w,this.$M+e);if(c===I)return this.set(I,this.$y+e);if(c===F)return d(1);if(c===k)return d(7);var M=(n={},n[y]=g,n[S]=W,n[$]=B,n)[c]||1,_=this.$d.getTime()+e*M;return l.w(_,this)},t.subtract=function(e,s){return this.add(-1*e,s)},t.format=function(e){var s=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var u=e||"YYYY-MM-DDTHH:mm:ssZ",c=l.z(this),d=this.$H,M=this.$m,_=this.$M,Y=n.weekdays,T=n.months,q=n.meridiem,N=function(O,V,U,J){return O&&(O[V]||O(s,u))||U[V].slice(0,J)},Q=function(O){return l.s(d%12||12,O,"0")},A=q||function(O,V,U){var J=O<12?"AM":"PM";return U?J.toLowerCase():J};return u.replace(o,(function(O,V){return V||(function(U){switch(U){case"YY":return String(s.$y).slice(-2);case"YYYY":return l.s(s.$y,4,"0");case"M":return _+1;case"MM":return l.s(_+1,2,"0");case"MMM":return N(n.monthsShort,_,T,3);case"MMMM":return N(T,_);case"D":return s.$D;case"DD":return l.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return N(n.weekdaysMin,s.$W,Y,2);case"ddd":return N(n.weekdaysShort,s.$W,Y,3);case"dddd":return Y[s.$W];case"H":return String(d);case"HH":return l.s(d,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return A(d,M,!0);case"A":return A(d,M,!1);case"m":return String(M);case"mm":return l.s(M,2,"0");case"s":return String(s.$s);case"ss":return l.s(s.$s,2,"0");case"SSS":return l.s(s.$ms,3,"0");case"Z":return c}return null})(O)||c.replace(":","")}))},t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},t.diff=function(e,s,n){var u,c=this,d=l.p(s),M=h(e),_=(M.utcOffset()-this.utcOffset())*g,Y=this-M,T=function(){return l.m(c,M)};switch(d){case I:u=T()/12;break;case w:u=T();break;case Z:u=T()/3;break;case k:u=(Y-_)/6048e5;break;case F:u=(Y-_)/864e5;break;case S:u=Y/W;break;case y:u=Y/g;break;case $:u=Y/B;break;default:u=Y}return n?u:l.a(u)},t.daysInMonth=function(){return this.endOf(w).$D},t.$locale=function(){return x[this.$L]},t.locale=function(e,s){if(!e)return this.$L;var n=this.clone(),u=D(e,s,!0);return u&&(n.$L=u),n},t.clone=function(){return l.w(this.$d,this)},t.toDate=function(){return new Date(this.valueOf())},t.toJSON=function(){return this.isValid()?this.toISOString():null},t.toISOString=function(){return this.$d.toISOString()},t.toString=function(){return this.$d.toUTCString()},i})(),C=L.prototype;return h.prototype=C,[["$ms",H],["$s",$],["$m",y],["$H",S],["$W",F],["$M",w],["$y",I],["$D",X]].forEach((function(i){C[i[1]]=function(t){return this.$g(t,i[0],i[1])}})),h.extend=function(i,t){return i.$i||(i(t,L,h),i.$i=!0),h},h.locale=D,h.isDayjs=m,h.unix=function(i){return h(1e3*i)},h.en=x[E],h.Ls=x,h.p={},h}))})(ee)),ee.exports}var $e=pe();const j=le($e);var te={exports:{}},ve=te.exports,ce;function De(){return ce||(ce=1,(function(z,ne){(function(B,g){z.exports=g()})(ve,(function(){var B={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},g=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,W=/\d/,H=/\d\d/,$=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,S={},F=function(a){return(a=+a)+(a>68?1900:2e3)},k=function(a){return function(o){this[a]=+o}},w=[/[+-]\d\d:?(\d\d)?|Z/,function(a){(this.zone||(this.zone={})).offset=(function(o){if(!o||o==="Z")return 0;var p=o.match(/([+-]|\d\d)/g),v=60*p[1]+(+p[2]||0);return v===0?0:p[0]==="+"?-v:v})(a)}],Z=function(a){var o=S[a];return o&&(o.indexOf?o:o.s.concat(o.f))},I=function(a,o){var p,v=S.meridiem;if(v){for(var P=1;P<=24;P+=1)if(a.indexOf(v(P,0,o))>-1){p=P>12;break}}else p=a===(o?"pm":"PM");return p},X={A:[y,function(a){this.afternoon=I(a,!1)}],a:[y,function(a){this.afternoon=I(a,!0)}],Q:[W,function(a){this.month=3*(a-1)+1}],S:[W,function(a){this.milliseconds=100*+a}],SS:[H,function(a){this.milliseconds=10*+a}],SSS:[/\d{3}/,function(a){this.milliseconds=+a}],s:[$,k("seconds")],ss:[$,k("seconds")],m:[$,k("minutes")],mm:[$,k("minutes")],H:[$,k("hours")],h:[$,k("hours")],HH:[$,k("hours")],hh:[$,k("hours")],D:[$,k("day")],DD:[H,k("day")],Do:[y,function(a){var o=S.ordinal,p=a.match(/\d+/);if(this.day=p[0],o)for(var v=1;v<=31;v+=1)o(v).replace(/\[|\]/g,"")===a&&(this.day=v)}],w:[$,k("week")],ww:[H,k("week")],M:[$,k("month")],MM:[H,k("month")],MMM:[y,function(a){var o=Z("months"),p=(Z("monthsShort")||o.map((function(v){return v.slice(0,3)}))).indexOf(a)+1;if(p<1)throw new Error;this.month=p%12||p}],MMMM:[y,function(a){var o=Z("months").indexOf(a)+1;if(o<1)throw new Error;this.month=o%12||o}],Y:[/[+-]?\d+/,k("year")],YY:[H,function(a){this.year=F(a)}],YYYY:[/\d{4}/,k("year")],Z:w,ZZ:w};function f(a){var o,p;o=a,p=S&&S.formats;for(var v=(a=o.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(h,l,L){var C=L&&L.toUpperCase();return l||p[L]||B[L]||p[C].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(i,t,e){return t||e.slice(1)}))}))).match(g),P=v.length,E=0;E<P;E+=1){var x=v[E],R=X[x],m=R&&R[0],D=R&&R[1];v[E]=D?{regex:m,parser:D}:x.replace(/^\[|\]$/g,"")}return function(h){for(var l={},L=0,C=0;L<P;L+=1){var i=v[L];if(typeof i=="string")C+=i.length;else{var t=i.regex,e=i.parser,s=h.slice(C),n=t.exec(s)[0];e.call(l,n),h=h.replace(n,"")}}return(function(u){var c=u.afternoon;if(c!==void 0){var d=u.hours;c?d<12&&(u.hours+=12):d===12&&(u.hours=0),delete u.afternoon}})(l),l}}return function(a,o,p){p.p.customParseFormat=!0,a&&a.parseTwoDigitYear&&(F=a.parseTwoDigitYear);var v=o.prototype,P=v.parse;v.parse=function(E){var x=E.date,R=E.utc,m=E.args;this.$u=R;var D=m[1];if(typeof D=="string"){var h=m[2]===!0,l=m[3]===!0,L=h||l,C=m[2];l&&(C=m[2]),S=this.$locale(),!h&&C&&(S=p.Ls[C]),this.$d=(function(s,n,u,c){try{if(["x","X"].indexOf(n)>-1)return new Date((n==="X"?1e3:1)*s);var d=f(n)(s),M=d.year,_=d.month,Y=d.day,T=d.hours,q=d.minutes,N=d.seconds,Q=d.milliseconds,A=d.zone,O=d.week,V=new Date,U=Y||(M||_?1:V.getDate()),J=M||V.getFullYear(),G=0;M&&!_||(G=_>0?_-1:V.getMonth());var K,re=T||0,ae=q||0,se=N||0,ie=Q||0;return A?new Date(Date.UTC(J,G,U,re,ae,se,ie+60*A.offset*1e3)):u?new Date(Date.UTC(J,G,U,re,ae,se,ie)):(K=new Date(J,G,U,re,ae,se,ie),O&&(K=c(K).week(O).toDate()),K)}catch{return new Date("")}})(x,D,R,p),this.init(),C&&C!==!0&&(this.$L=this.locale(C).$L),L&&x!=this.format(D)&&(this.$d=new Date("")),S={}}else if(D instanceof Array)for(var i=D.length,t=1;t<=i;t+=1){m[1]=D[t-1];var e=p.apply(this,m);if(e.isValid()){this.$d=e.$d,this.$L=e.$L,this.init();break}t===i&&(this.$d=new Date(""))}else P.call(this,E)}}}))})(te)),te.exports}var ye=De();const Me=le(ye),ke=["innerHTML"],_e=["innerHTML"],ge=["onClick"],oe="YYYY-MM-DD",Se=r.defineComponent({name:"ScDatePicker",__name:"date-picker",props:{modelValue:{default:null},format:{default:oe},disabled:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},minDate:{default:void 0},maxDate:{default:void 0}},emits:["update:modelValue","change"],setup(z,{emit:ne}){j.extend(Me);const B=he.ChevronDownIcon,g=z,W=ne,H=r.inject("scLocale",fe.enUS),$=r.ref(new Date().getFullYear()),y=r.ref(new Date().getMonth()),S=f=>{if(f==null)return null;if(f instanceof Date){const a=j(f);return a.isValid()?a:null}if(typeof f=="string"){const a=j(f,g.format||oe,!0);if(a.isValid())return a;const o=j(f);return o.isValid()?o:null}return null},F=r.computed(()=>S(g.modelValue)),k=r.computed(()=>{const f=[],a=j().year($.value).month(y.value).date(1),o=a.endOf("month"),p=a.subtract(1,"day"),v=j(),P=a.day(),E=P===0?6:P-1;for(let m=E-1;m>=0;m--){const D=p.date()-m,h=j().year($.value).month(y.value-1).date(D);f.push({date:D,fullDate:h,key:`prev-${D}`,isOtherMonth:!0,isToday:!1,isSelected:!1,isDisabled:w(h)})}const x=o.date();for(let m=1;m<=x;m++){const D=j().year($.value).month(y.value).date(m),h=D.isSame(v,"day"),l=F.value?D.isSame(F.value,"day"):!1;f.push({date:m,fullDate:D,key:`current-${m}`,isOtherMonth:!1,isToday:h,isSelected:l,isDisabled:w(D)})}const R=42-f.length;for(let m=1;m<=R;m++){const D=j().year($.value).month(y.value+1).date(m);f.push({date:m,fullDate:D,key:`next-${m}`,isOtherMonth:!0,isToday:!1,isSelected:!1,isDisabled:w(D)})}return f});function w(f){if(g.minDate){const a=S(g.minDate);if(a&&f.isBefore(a,"day"))return!0}if(g.maxDate){const a=S(g.maxDate);if(a&&f.isAfter(a,"day"))return!0}return!1}function Z(f){f.preventDefault(),y.value===0?(y.value=11,$.value--):y.value--}function I(f){f.preventDefault(),y.value===11?(y.value=0,$.value++):y.value++}function X(f,a){if(f.preventDefault(),a.isDisabled||g.disabled)return;const o=typeof g.modelValue=="string"?a.fullDate.format(g.format||oe):a.fullDate.toDate();W("update:modelValue",o),W("change",o)}return r.watch(F,f=>{f&&($.value=f.year(),y.value=f.month())},{immediate:!0}),(f,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([`${r.unref(b.PREFIX)}-date-picker`,{[`${r.unref(b.PREFIX)}-date-picker--disabled`]:f.disabled,[`${r.unref(b.PREFIX)}-date-picker--dark`]:f.dark}])},[r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__panel`)},[r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__header`)},[r.createElementVNode("button",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav`),onClick:Z},[r.createElementVNode("span",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav-prev`),innerHTML:r.unref(B),"aria-hidden":"true"},null,10,ke)],2),r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__header-label`)},r.toDisplayString(r.unref(H).datePicker.months[y.value])+" "+r.toDisplayString($.value),3),r.createElementVNode("button",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav`),onClick:I},[r.createElementVNode("span",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav-next`),innerHTML:r.unref(B),"aria-hidden":"true"},null,10,_e)],2)],2),r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__weekdays`)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(H).datePicker.weekdays,o=>(r.openBlock(),r.createElementBlock("div",{key:o,class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__weekday`)},r.toDisplayString(o),3))),128))],2),r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__days`)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,o=>(r.openBlock(),r.createElementBlock("div",{key:o.key,class:r.normalizeClass([`${r.unref(b.PREFIX)}-date-picker__day`,{[`${r.unref(b.PREFIX)}-date-picker__day--today`]:o.isToday,[`${r.unref(b.PREFIX)}-date-picker__day--selected`]:o.isSelected,[`${r.unref(b.PREFIX)}-date-picker__day--other-month`]:o.isOtherMonth,[`${r.unref(b.PREFIX)}-date-picker__day--disabled`]:o.isDisabled}]),onClick:p=>X(p,o)},r.toDisplayString(o.date),11,ge))),128))],2)],2)],2))}}),we=de.withInstall(Se);exports.ScDatePicker=we;exports.dayjs=j;
|
|
1
|
+
"use strict";const de=require("./_utils-CtkVBTg-.cjs"),r=require("vue"),b=require("./_vars-CyrPevgT.cjs"),fe=require("./en-US-UkqgG0fb.cjs"),he=require("./_icons-B94owPWc.cjs");function le(z){return z&&z.__esModule&&Object.prototype.hasOwnProperty.call(z,"default")?z.default:z}var ee={exports:{}},me=ee.exports,ue;function pe(){return ue||(ue=1,(function(z,ne){(function(B,g){z.exports=g()})(me,(function(){var B=1e3,g=6e4,W=36e5,H="millisecond",$="second",y="minute",S="hour",F="day",k="week",w="month",Z="quarter",I="year",X="date",f="Invalid Date",a=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(i){var t=["th","st","nd","rd"],e=i%100;return"["+i+(t[(e-20)%10]||t[e]||t[0])+"]"}},v=function(i,t,e){var s=String(i);return!s||s.length>=t?i:""+Array(t+1-s.length).join(e)+i},P={s:v,z:function(i){var t=-i.utcOffset(),e=Math.abs(t),s=Math.floor(e/60),n=e%60;return(t<=0?"+":"-")+v(s,2,"0")+":"+v(n,2,"0")},m:function i(t,e){if(t.date()<e.date())return-i(e,t);var s=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(s,w),u=e-n<0,c=t.clone().add(s+(u?-1:1),w);return+(-(s+(e-n)/(u?n-c:c-n))||0)},a:function(i){return i<0?Math.ceil(i)||0:Math.floor(i)},p:function(i){return{M:w,y:I,w:k,d:F,D:X,h:S,m:y,s:$,ms:H,Q:Z}[i]||String(i||"").toLowerCase().replace(/s$/,"")},u:function(i){return i===void 0}},E="en",x={};x[E]=p;var R="$isDayjsObject",m=function(i){return i instanceof L||!(!i||!i[R])},D=function i(t,e,s){var n;if(!t)return E;if(typeof t=="string"){var u=t.toLowerCase();x[u]&&(n=u),e&&(x[u]=e,n=u);var c=t.split("-");if(!n&&c.length>1)return i(c[0])}else{var d=t.name;x[d]=t,n=d}return!s&&n&&(E=n),n||!s&&E},h=function(i,t){if(m(i))return i.clone();var e=typeof t=="object"?t:{};return e.date=i,e.args=arguments,new L(e)},l=P;l.l=D,l.i=m,l.w=function(i,t){return h(i,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var L=(function(){function i(e){this.$L=D(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[R]=!0}var t=i.prototype;return t.parse=function(e){this.$d=(function(s){var n=s.date,u=s.utc;if(n===null)return new Date(NaN);if(l.u(n))return new Date;if(n instanceof Date)return new Date(n);if(typeof n=="string"&&!/Z$/i.test(n)){var c=n.match(a);if(c){var d=c[2]-1||0,M=(c[7]||"0").substring(0,3);return u?new Date(Date.UTC(c[1],d,c[3]||1,c[4]||0,c[5]||0,c[6]||0,M)):new Date(c[1],d,c[3]||1,c[4]||0,c[5]||0,c[6]||0,M)}}return new Date(n)})(e),this.init()},t.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},t.$utils=function(){return l},t.isValid=function(){return this.$d.toString()!==f},t.isSame=function(e,s){var n=h(e);return this.startOf(s)<=n&&n<=this.endOf(s)},t.isAfter=function(e,s){return h(e)<this.startOf(s)},t.isBefore=function(e,s){return this.endOf(s)<h(e)},t.$g=function(e,s,n){return l.u(e)?this[s]:this.set(n,e)},t.unix=function(){return Math.floor(this.valueOf()/1e3)},t.valueOf=function(){return this.$d.getTime()},t.startOf=function(e,s){var n=this,u=!!l.u(s)||s,c=l.p(e),d=function(A,O){var V=l.w(n.$u?Date.UTC(n.$y,O,A):new Date(n.$y,O,A),n);return u?V:V.endOf(F)},M=function(A,O){return l.w(n.toDate()[A].apply(n.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(O)),n)},_=this.$W,Y=this.$M,T=this.$D,q="set"+(this.$u?"UTC":"");switch(c){case I:return u?d(1,0):d(31,11);case w:return u?d(1,Y):d(0,Y+1);case k:var N=this.$locale().weekStart||0,Q=(_<N?_+7:_)-N;return d(u?T-Q:T+(6-Q),Y);case F:case X:return M(q+"Hours",0);case S:return M(q+"Minutes",1);case y:return M(q+"Seconds",2);case $:return M(q+"Milliseconds",3);default:return this.clone()}},t.endOf=function(e){return this.startOf(e,!1)},t.$set=function(e,s){var n,u=l.p(e),c="set"+(this.$u?"UTC":""),d=(n={},n[F]=c+"Date",n[X]=c+"Date",n[w]=c+"Month",n[I]=c+"FullYear",n[S]=c+"Hours",n[y]=c+"Minutes",n[$]=c+"Seconds",n[H]=c+"Milliseconds",n)[u],M=u===F?this.$D+(s-this.$W):s;if(u===w||u===I){var _=this.clone().set(X,1);_.$d[d](M),_.init(),this.$d=_.set(X,Math.min(this.$D,_.daysInMonth())).$d}else d&&this.$d[d](M);return this.init(),this},t.set=function(e,s){return this.clone().$set(e,s)},t.get=function(e){return this[l.p(e)]()},t.add=function(e,s){var n,u=this;e=Number(e);var c=l.p(s),d=function(Y){var T=h(u);return l.w(T.date(T.date()+Math.round(Y*e)),u)};if(c===w)return this.set(w,this.$M+e);if(c===I)return this.set(I,this.$y+e);if(c===F)return d(1);if(c===k)return d(7);var M=(n={},n[y]=g,n[S]=W,n[$]=B,n)[c]||1,_=this.$d.getTime()+e*M;return l.w(_,this)},t.subtract=function(e,s){return this.add(-1*e,s)},t.format=function(e){var s=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var u=e||"YYYY-MM-DDTHH:mm:ssZ",c=l.z(this),d=this.$H,M=this.$m,_=this.$M,Y=n.weekdays,T=n.months,q=n.meridiem,N=function(O,V,U,J){return O&&(O[V]||O(s,u))||U[V].slice(0,J)},Q=function(O){return l.s(d%12||12,O,"0")},A=q||function(O,V,U){var J=O<12?"AM":"PM";return U?J.toLowerCase():J};return u.replace(o,(function(O,V){return V||(function(U){switch(U){case"YY":return String(s.$y).slice(-2);case"YYYY":return l.s(s.$y,4,"0");case"M":return _+1;case"MM":return l.s(_+1,2,"0");case"MMM":return N(n.monthsShort,_,T,3);case"MMMM":return N(T,_);case"D":return s.$D;case"DD":return l.s(s.$D,2,"0");case"d":return String(s.$W);case"dd":return N(n.weekdaysMin,s.$W,Y,2);case"ddd":return N(n.weekdaysShort,s.$W,Y,3);case"dddd":return Y[s.$W];case"H":return String(d);case"HH":return l.s(d,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return A(d,M,!0);case"A":return A(d,M,!1);case"m":return String(M);case"mm":return l.s(M,2,"0");case"s":return String(s.$s);case"ss":return l.s(s.$s,2,"0");case"SSS":return l.s(s.$ms,3,"0");case"Z":return c}return null})(O)||c.replace(":","")}))},t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},t.diff=function(e,s,n){var u,c=this,d=l.p(s),M=h(e),_=(M.utcOffset()-this.utcOffset())*g,Y=this-M,T=function(){return l.m(c,M)};switch(d){case I:u=T()/12;break;case w:u=T();break;case Z:u=T()/3;break;case k:u=(Y-_)/6048e5;break;case F:u=(Y-_)/864e5;break;case S:u=Y/W;break;case y:u=Y/g;break;case $:u=Y/B;break;default:u=Y}return n?u:l.a(u)},t.daysInMonth=function(){return this.endOf(w).$D},t.$locale=function(){return x[this.$L]},t.locale=function(e,s){if(!e)return this.$L;var n=this.clone(),u=D(e,s,!0);return u&&(n.$L=u),n},t.clone=function(){return l.w(this.$d,this)},t.toDate=function(){return new Date(this.valueOf())},t.toJSON=function(){return this.isValid()?this.toISOString():null},t.toISOString=function(){return this.$d.toISOString()},t.toString=function(){return this.$d.toUTCString()},i})(),C=L.prototype;return h.prototype=C,[["$ms",H],["$s",$],["$m",y],["$H",S],["$W",F],["$M",w],["$y",I],["$D",X]].forEach((function(i){C[i[1]]=function(t){return this.$g(t,i[0],i[1])}})),h.extend=function(i,t){return i.$i||(i(t,L,h),i.$i=!0),h},h.locale=D,h.isDayjs=m,h.unix=function(i){return h(1e3*i)},h.en=x[E],h.Ls=x,h.p={},h}))})(ee)),ee.exports}var $e=pe();const j=le($e);var te={exports:{}},ve=te.exports,ce;function De(){return ce||(ce=1,(function(z,ne){(function(B,g){z.exports=g()})(ve,(function(){var B={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},g=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,W=/\d/,H=/\d\d/,$=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,S={},F=function(a){return(a=+a)+(a>68?1900:2e3)},k=function(a){return function(o){this[a]=+o}},w=[/[+-]\d\d:?(\d\d)?|Z/,function(a){(this.zone||(this.zone={})).offset=(function(o){if(!o||o==="Z")return 0;var p=o.match(/([+-]|\d\d)/g),v=60*p[1]+(+p[2]||0);return v===0?0:p[0]==="+"?-v:v})(a)}],Z=function(a){var o=S[a];return o&&(o.indexOf?o:o.s.concat(o.f))},I=function(a,o){var p,v=S.meridiem;if(v){for(var P=1;P<=24;P+=1)if(a.indexOf(v(P,0,o))>-1){p=P>12;break}}else p=a===(o?"pm":"PM");return p},X={A:[y,function(a){this.afternoon=I(a,!1)}],a:[y,function(a){this.afternoon=I(a,!0)}],Q:[W,function(a){this.month=3*(a-1)+1}],S:[W,function(a){this.milliseconds=100*+a}],SS:[H,function(a){this.milliseconds=10*+a}],SSS:[/\d{3}/,function(a){this.milliseconds=+a}],s:[$,k("seconds")],ss:[$,k("seconds")],m:[$,k("minutes")],mm:[$,k("minutes")],H:[$,k("hours")],h:[$,k("hours")],HH:[$,k("hours")],hh:[$,k("hours")],D:[$,k("day")],DD:[H,k("day")],Do:[y,function(a){var o=S.ordinal,p=a.match(/\d+/);if(this.day=p[0],o)for(var v=1;v<=31;v+=1)o(v).replace(/\[|\]/g,"")===a&&(this.day=v)}],w:[$,k("week")],ww:[H,k("week")],M:[$,k("month")],MM:[H,k("month")],MMM:[y,function(a){var o=Z("months"),p=(Z("monthsShort")||o.map((function(v){return v.slice(0,3)}))).indexOf(a)+1;if(p<1)throw new Error;this.month=p%12||p}],MMMM:[y,function(a){var o=Z("months").indexOf(a)+1;if(o<1)throw new Error;this.month=o%12||o}],Y:[/[+-]?\d+/,k("year")],YY:[H,function(a){this.year=F(a)}],YYYY:[/\d{4}/,k("year")],Z:w,ZZ:w};function f(a){var o,p;o=a,p=S&&S.formats;for(var v=(a=o.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(h,l,L){var C=L&&L.toUpperCase();return l||p[L]||B[L]||p[C].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(i,t,e){return t||e.slice(1)}))}))).match(g),P=v.length,E=0;E<P;E+=1){var x=v[E],R=X[x],m=R&&R[0],D=R&&R[1];v[E]=D?{regex:m,parser:D}:x.replace(/^\[|\]$/g,"")}return function(h){for(var l={},L=0,C=0;L<P;L+=1){var i=v[L];if(typeof i=="string")C+=i.length;else{var t=i.regex,e=i.parser,s=h.slice(C),n=t.exec(s)[0];e.call(l,n),h=h.replace(n,"")}}return(function(u){var c=u.afternoon;if(c!==void 0){var d=u.hours;c?d<12&&(u.hours+=12):d===12&&(u.hours=0),delete u.afternoon}})(l),l}}return function(a,o,p){p.p.customParseFormat=!0,a&&a.parseTwoDigitYear&&(F=a.parseTwoDigitYear);var v=o.prototype,P=v.parse;v.parse=function(E){var x=E.date,R=E.utc,m=E.args;this.$u=R;var D=m[1];if(typeof D=="string"){var h=m[2]===!0,l=m[3]===!0,L=h||l,C=m[2];l&&(C=m[2]),S=this.$locale(),!h&&C&&(S=p.Ls[C]),this.$d=(function(s,n,u,c){try{if(["x","X"].indexOf(n)>-1)return new Date((n==="X"?1e3:1)*s);var d=f(n)(s),M=d.year,_=d.month,Y=d.day,T=d.hours,q=d.minutes,N=d.seconds,Q=d.milliseconds,A=d.zone,O=d.week,V=new Date,U=Y||(M||_?1:V.getDate()),J=M||V.getFullYear(),G=0;M&&!_||(G=_>0?_-1:V.getMonth());var K,re=T||0,ae=q||0,se=N||0,ie=Q||0;return A?new Date(Date.UTC(J,G,U,re,ae,se,ie+60*A.offset*1e3)):u?new Date(Date.UTC(J,G,U,re,ae,se,ie)):(K=new Date(J,G,U,re,ae,se,ie),O&&(K=c(K).week(O).toDate()),K)}catch{return new Date("")}})(x,D,R,p),this.init(),C&&C!==!0&&(this.$L=this.locale(C).$L),L&&x!=this.format(D)&&(this.$d=new Date("")),S={}}else if(D instanceof Array)for(var i=D.length,t=1;t<=i;t+=1){m[1]=D[t-1];var e=p.apply(this,m);if(e.isValid()){this.$d=e.$d,this.$L=e.$L,this.init();break}t===i&&(this.$d=new Date(""))}else P.call(this,E)}}}))})(te)),te.exports}var ye=De();const Me=le(ye),ke=["innerHTML"],_e=["innerHTML"],ge=["onClick"],oe="YYYY-MM-DD",Se=r.defineComponent({name:"ScDatePicker",__name:"date-picker",props:{modelValue:{default:null},format:{default:oe},disabled:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},minDate:{default:void 0},maxDate:{default:void 0}},emits:["update:modelValue","change"],setup(z,{emit:ne}){j.extend(Me);const B=he.ChevronDownIcon,g=z,W=ne,H=r.inject("scLocale",fe.enUS),$=r.ref(new Date().getFullYear()),y=r.ref(new Date().getMonth()),S=f=>{if(f==null)return null;if(f instanceof Date){const a=j(f);return a.isValid()?a:null}if(typeof f=="string"){const a=j(f,g.format||oe,!0);if(a.isValid())return a;const o=j(f);return o.isValid()?o:null}return null},F=r.computed(()=>S(g.modelValue)),k=r.computed(()=>{const f=[],a=j().year($.value).month(y.value).date(1),o=a.endOf("month"),p=a.subtract(1,"day"),v=j(),P=a.day(),E=P===0?6:P-1;for(let m=E-1;m>=0;m--){const D=p.date()-m,h=j().year($.value).month(y.value-1).date(D);f.push({date:D,fullDate:h,key:`prev-${D}`,isOtherMonth:!0,isToday:!1,isSelected:!1,isDisabled:w(h)})}const x=o.date();for(let m=1;m<=x;m++){const D=j().year($.value).month(y.value).date(m),h=D.isSame(v,"day"),l=F.value?D.isSame(F.value,"day"):!1;f.push({date:m,fullDate:D,key:`current-${m}`,isOtherMonth:!1,isToday:h,isSelected:l,isDisabled:w(D)})}const R=42-f.length;for(let m=1;m<=R;m++){const D=j().year($.value).month(y.value+1).date(m);f.push({date:m,fullDate:D,key:`next-${m}`,isOtherMonth:!0,isToday:!1,isSelected:!1,isDisabled:w(D)})}return f});function w(f){if(g.minDate){const a=S(g.minDate);if(a&&f.isBefore(a,"day"))return!0}if(g.maxDate){const a=S(g.maxDate);if(a&&f.isAfter(a,"day"))return!0}return!1}function Z(f){f.preventDefault(),y.value===0?(y.value=11,$.value--):y.value--}function I(f){f.preventDefault(),y.value===11?(y.value=0,$.value++):y.value++}function X(f,a){if(f.preventDefault(),a.isDisabled||g.disabled)return;const o=typeof g.modelValue=="string"?a.fullDate.format(g.format||oe):a.fullDate.toDate();W("update:modelValue",o),W("change",o)}return r.watch(F,f=>{f&&($.value=f.year(),y.value=f.month())},{immediate:!0}),(f,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([`${r.unref(b.PREFIX)}-date-picker`,{[`${r.unref(b.PREFIX)}-date-picker--disabled`]:f.disabled,[`${r.unref(b.PREFIX)}-date-picker--dark`]:f.dark}])},[r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__panel`)},[r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__header`)},[r.createElementVNode("button",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav`),onClick:Z},[r.createElementVNode("span",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav-prev`),innerHTML:r.unref(B),"aria-hidden":"true"},null,10,ke)],2),r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__header-label`)},r.toDisplayString(r.unref(H).datePicker.months[y.value])+" "+r.toDisplayString($.value),3),r.createElementVNode("button",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav`),onClick:I},[r.createElementVNode("span",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__nav-next`),innerHTML:r.unref(B),"aria-hidden":"true"},null,10,_e)],2)],2),r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__weekdays`)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(H).datePicker.weekdays,o=>(r.openBlock(),r.createElementBlock("div",{key:o,class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__weekday`)},r.toDisplayString(o),3))),128))],2),r.createElementVNode("div",{class:r.normalizeClass(`${r.unref(b.PREFIX)}-date-picker__days`)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(k.value,o=>(r.openBlock(),r.createElementBlock("div",{key:o.key,class:r.normalizeClass([`${r.unref(b.PREFIX)}-date-picker__day`,{[`${r.unref(b.PREFIX)}-date-picker__day--today`]:o.isToday,[`${r.unref(b.PREFIX)}-date-picker__day--selected`]:o.isSelected,[`${r.unref(b.PREFIX)}-date-picker__day--other-month`]:o.isOtherMonth,[`${r.unref(b.PREFIX)}-date-picker__day--disabled`]:o.isDisabled}]),onClick:p=>X(p,o)},r.toDisplayString(o.date),11,ge))),128))],2)],2)],2))}}),we=de.withInstall(Se);exports.ScDatePicker=we;exports.dayjs=j;
|