vue-amazing-ui 2.2.12 → 2.2.13
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/index.iife.js +52 -41
- package/dist/index.js +4226 -4195
- package/dist/index.umd.cjs +51 -40
- package/dist/style.css +1 -1
- package/es/calendar/Calendar.css +1 -1
- package/es/calendar/Calendar.d.ts +6 -0
- package/es/calendar/Calendar.vue.js +2 -2
- package/es/calendar/Calendar.vue2.js +130 -126
- package/es/calendar/index.d.ts +9 -0
- package/es/colorpicker/ColorPicker.css +1 -1
- package/es/colorpicker/ColorPicker.d.ts +4 -0
- package/es/colorpicker/ColorPicker.vue.js +2 -2
- package/es/colorpicker/ColorPicker.vue2.js +244 -234
- package/es/colorpicker/index.d.ts +6 -0
- package/es/pagination/Pagination.css +1 -1
- package/es/pagination/Pagination.d.ts +1 -0
- package/es/pagination/Pagination.vue.js +2 -2
- package/es/pagination/Pagination.vue2.js +119 -102
- package/es/pagination/index.d.ts +1 -0
- package/es/select/Select.css +1 -1
- package/es/select/Select.vue.js +2 -2
- package/es/select/Select.vue2.js +84 -84
- package/lib/calendar/Calendar.css +1 -1
- package/lib/calendar/Calendar.d.ts +6 -0
- package/lib/calendar/Calendar.vue.cjs +1 -1
- package/lib/calendar/Calendar.vue2.cjs +5 -1
- package/lib/calendar/index.d.ts +9 -0
- package/lib/colorpicker/ColorPicker.css +1 -1
- package/lib/colorpicker/ColorPicker.d.ts +4 -0
- package/lib/colorpicker/ColorPicker.vue.cjs +1 -1
- package/lib/colorpicker/ColorPicker.vue2.cjs +10 -3
- package/lib/colorpicker/index.d.ts +6 -0
- package/lib/pagination/Pagination.css +1 -1
- package/lib/pagination/Pagination.d.ts +1 -0
- package/lib/pagination/Pagination.vue.cjs +1 -1
- package/lib/pagination/Pagination.vue2.cjs +1 -1
- package/lib/pagination/index.d.ts +1 -0
- package/lib/select/Select.css +1 -1
- package/lib/select/Select.vue.cjs +1 -1
- package/lib/select/Select.vue2.cjs +4 -4
- package/package.json +2 -2
package/es/select/Select.vue2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, ref as o, computed as $, watchEffect as F, watch as _, nextTick as ee, createElementBlock as r, openBlock as v, normalizeStyle as le, normalizeClass as h, createElementVNode as w, createVNode as V, createCommentVNode as T, withDirectives as ae, vModelText as se, toDisplayString as D, withModifiers as B, Transition as te, withCtx as E, unref as N, mergeProps as oe, Fragment as ue, renderList as ne } from "vue";
|
|
2
2
|
import ie from "../empty/index.js";
|
|
3
3
|
import re from "../scrollbar/index.js";
|
|
4
|
-
const ve = { class: "select-search" },
|
|
4
|
+
const ve = { class: "select-search" }, de = ["readonly", "disabled"], ce = ["title"], fe = ["title", "onMouseenter", "onClick"], ge = /* @__PURE__ */ x({
|
|
5
5
|
__name: "Select",
|
|
6
6
|
props: {
|
|
7
7
|
options: { default: () => [] },
|
|
@@ -20,23 +20,23 @@ const ve = { class: "select-search" }, ce = ["readonly", "disabled"], de = ["tit
|
|
|
20
20
|
modelValue: { default: void 0 }
|
|
21
21
|
},
|
|
22
22
|
emits: ["update:modelValue", "change", "openChange"],
|
|
23
|
-
setup(
|
|
24
|
-
const l =
|
|
23
|
+
setup(R, { emit: H }) {
|
|
24
|
+
const l = R, i = o(), u = o(), C = o(null), d = o(), c = o(!1), k = o(!1), n = o(), b = o(), z = o(0), t = o(!1), f = o(!0), m = o(!1), S = o(!1), p = o(!1), M = o(!1), y = H, P = $(() => typeof l.width == "number" ? `${l.width}px` : l.width), I = $(() => {
|
|
25
25
|
const e = {
|
|
26
26
|
small: 24,
|
|
27
27
|
middle: 32,
|
|
28
28
|
large: 40
|
|
29
29
|
};
|
|
30
30
|
return l.height !== void 0 ? `${l.height}px` : `${e[l.size]}px`;
|
|
31
|
-
}),
|
|
31
|
+
}), O = $(() => l.options.length > l.maxDisplay), A = $(() => ({
|
|
32
32
|
maxHeight: `${l.maxDisplay * 32 + 8}px`
|
|
33
33
|
}));
|
|
34
|
-
|
|
35
|
-
l.search ? (
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
}), _(
|
|
39
|
-
if (
|
|
34
|
+
F(() => {
|
|
35
|
+
l.search ? (d.value ? (t.value = !0, i.value = l.options.filter((e) => typeof l.filter == "function" ? l.filter(d.value, e) : e[l.label].includes(d.value))) : i.value = [...l.options], i.value.length && d.value ? n.value = i.value[0][l.value] : n.value = null) : i.value = l.options;
|
|
36
|
+
}), F(() => {
|
|
37
|
+
U();
|
|
38
|
+
}), _(t, async (e) => {
|
|
39
|
+
if (O.value)
|
|
40
40
|
if (e)
|
|
41
41
|
await ee(), b.value && b.value.scrollTo({
|
|
42
42
|
top: z.value,
|
|
@@ -46,98 +46,98 @@ const ve = { class: "select-search" }, ce = ["readonly", "disabled"], de = ["tit
|
|
|
46
46
|
const a = b.value && b.value.getScrollData();
|
|
47
47
|
z.value = (a == null ? void 0 : a.scrollTop) || 0;
|
|
48
48
|
}
|
|
49
|
-
y("openChange", e), l.search && !e && (
|
|
49
|
+
y("openChange", e), l.search && !e && (d.value = void 0, k.value = !1);
|
|
50
50
|
});
|
|
51
|
-
function
|
|
51
|
+
function U() {
|
|
52
52
|
if (l.modelValue) {
|
|
53
53
|
const e = l.options.find((a) => a[l.value] === l.modelValue);
|
|
54
54
|
e ? (u.value = e[l.label], n.value = e[l.value]) : (u.value = l.modelValue, n.value = null);
|
|
55
55
|
} else
|
|
56
56
|
u.value = null, n.value = null;
|
|
57
57
|
}
|
|
58
|
+
function W() {
|
|
59
|
+
M.value = !0;
|
|
60
|
+
}
|
|
58
61
|
function j() {
|
|
59
|
-
|
|
62
|
+
M.value = !1, t.value && (t.value = !1), l.search && (p.value = !1, f.value = !0, k.value = !1);
|
|
60
63
|
}
|
|
61
64
|
function q() {
|
|
62
|
-
|
|
65
|
+
c.value = !0, l.allowClear && (u.value || l.search && d.value) && (f.value = !1, m.value = !0, l.search && (p.value = !1));
|
|
63
66
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
67
|
+
function G() {
|
|
68
|
+
c.value = !1, l.allowClear && m.value && (m.value = !1, l.search || (f.value = !0)), l.search && (t.value ? (p.value = !0, f.value = !1) : (p.value = !1, f.value = !0));
|
|
66
69
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
70
|
+
function J(e, a) {
|
|
71
|
+
c.value = !!a, n.value = e;
|
|
69
72
|
}
|
|
70
|
-
function
|
|
71
|
-
if (
|
|
73
|
+
function K() {
|
|
74
|
+
if (g(), !l.search && C.value && (C.value.style.opacity = "0"), t.value = !t.value, !n.value && u.value) {
|
|
72
75
|
const e = l.options.find((a) => a[l.label] === u.value);
|
|
73
76
|
n.value = e ? e[l.value] : null;
|
|
74
77
|
}
|
|
75
|
-
l.search && (m.value || (f.value = !
|
|
78
|
+
l.search && (m.value || (f.value = !t.value, p.value = t.value));
|
|
76
79
|
}
|
|
77
|
-
function
|
|
80
|
+
function Q(e) {
|
|
78
81
|
var a;
|
|
79
|
-
|
|
82
|
+
k.value = !!((a = e.target) != null && a.value);
|
|
80
83
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
84
|
+
function X() {
|
|
85
|
+
M.value && (g(), S.value = !0), m.value = !1, u.value = null, n.value = null, t.value = !1, p.value = !1, f.value = !0, y("update:modelValue"), y("change");
|
|
83
86
|
}
|
|
84
|
-
function
|
|
87
|
+
function g() {
|
|
85
88
|
var e;
|
|
86
|
-
(e =
|
|
89
|
+
(e = C.value) == null || e.focus();
|
|
87
90
|
}
|
|
88
|
-
function
|
|
89
|
-
l.modelValue !== e && (u.value = a, n.value = e, y("update:modelValue", e), y("change", e, a,
|
|
90
|
-
}
|
|
91
|
-
function L() {
|
|
92
|
-
var e;
|
|
93
|
-
(e = w.value) == null || e.focus();
|
|
91
|
+
function Y(e, a, s) {
|
|
92
|
+
l.modelValue !== e && (u.value = a, n.value = e, y("update:modelValue", e), y("change", e, a, s)), S.value = !1, g();
|
|
94
93
|
}
|
|
95
94
|
return (e, a) => (v(), r("div", {
|
|
96
95
|
class: h(["m-select", {
|
|
97
|
-
"select-focused":
|
|
96
|
+
"select-focused": M.value,
|
|
98
97
|
"search-select": e.search,
|
|
99
98
|
"select-small": e.size === "small",
|
|
100
99
|
"select-large": e.size === "large",
|
|
101
100
|
"select-disabled": e.disabled
|
|
102
101
|
}]),
|
|
103
102
|
style: le(`
|
|
104
|
-
--select-width: ${
|
|
105
|
-
--select-height: ${
|
|
103
|
+
--select-width: ${P.value};
|
|
104
|
+
--select-height: ${I.value};
|
|
106
105
|
--select-primary-color-hover: #4096ff;
|
|
107
106
|
--select-primary-color-focus: #4096ff;
|
|
108
107
|
--select-primary-shadow-color: rgba(5, 145, 255, 0.1);
|
|
109
108
|
--select-item-bg-color-active: #e6f4ff;
|
|
110
109
|
`),
|
|
111
|
-
onClick: a[
|
|
110
|
+
onClick: a[7] || (a[7] = (s) => e.disabled ? () => !1 : K())
|
|
112
111
|
}, [
|
|
113
|
-
|
|
112
|
+
w("div", {
|
|
114
113
|
class: "select-wrap",
|
|
115
114
|
onMouseenter: q,
|
|
116
|
-
onMouseleave:
|
|
115
|
+
onMouseleave: G
|
|
117
116
|
}, [
|
|
118
|
-
|
|
119
|
-
ae(
|
|
117
|
+
w("span", ve, [
|
|
118
|
+
ae(w("input", {
|
|
120
119
|
ref_key: "inputRef",
|
|
121
|
-
ref:
|
|
122
|
-
class: h(["search-input", { "caret-show":
|
|
120
|
+
ref: C,
|
|
121
|
+
class: h(["search-input", { "caret-show": t.value || S.value }]),
|
|
123
122
|
type: "text",
|
|
124
123
|
autocomplete: "off",
|
|
125
124
|
readonly: !e.search,
|
|
126
125
|
disabled: e.disabled,
|
|
127
|
-
onInput:
|
|
128
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
129
|
-
onBlur: a[1] || (a[1] = (
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
onInput: Q,
|
|
127
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => d.value = s),
|
|
128
|
+
onBlur: a[1] || (a[1] = (s) => !c.value && !e.disabled ? j() : () => !1),
|
|
129
|
+
onFocus: a[2] || (a[2] = (s) => e.disabled ? () => !1 : W())
|
|
130
|
+
}, null, 42, de), [
|
|
131
|
+
[se, d.value]
|
|
132
132
|
])
|
|
133
133
|
]),
|
|
134
|
-
|
|
134
|
+
k.value ? T("", !0) : (v(), r("span", {
|
|
135
135
|
key: 0,
|
|
136
|
-
class: h(["select-item", { "select-placeholder": !u.value ||
|
|
136
|
+
class: h(["select-item", { "select-placeholder": !u.value || t.value }]),
|
|
137
137
|
title: u.value
|
|
138
|
-
},
|
|
138
|
+
}, D(u.value || e.placeholder), 11, ce)),
|
|
139
139
|
(v(), r("svg", {
|
|
140
|
-
class: h(["arrow-svg", { "arrow-rotate":
|
|
140
|
+
class: h(["arrow-svg", { "arrow-rotate": t.value, "show-svg": f.value }]),
|
|
141
141
|
focusable: "false",
|
|
142
142
|
"data-icon": "down",
|
|
143
143
|
width: "1em",
|
|
@@ -145,8 +145,8 @@ const ve = { class: "select-search" }, ce = ["readonly", "disabled"], de = ["tit
|
|
|
145
145
|
fill: "currentColor",
|
|
146
146
|
"aria-hidden": "true",
|
|
147
147
|
viewBox: "64 64 896 896"
|
|
148
|
-
}, a[
|
|
149
|
-
|
|
148
|
+
}, a[8] || (a[8] = [
|
|
149
|
+
w("path", { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" }, null, -1)
|
|
150
150
|
]), 2)),
|
|
151
151
|
(v(), r("svg", {
|
|
152
152
|
class: h(["search-svg", { "show-svg": p.value }]),
|
|
@@ -157,8 +157,8 @@ const ve = { class: "select-search" }, ce = ["readonly", "disabled"], de = ["tit
|
|
|
157
157
|
fill: "currentColor",
|
|
158
158
|
"aria-hidden": "true",
|
|
159
159
|
viewBox: "64 64 896 896"
|
|
160
|
-
}, a[
|
|
161
|
-
|
|
160
|
+
}, a[9] || (a[9] = [
|
|
161
|
+
w("path", { d: "M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z" }, null, -1)
|
|
162
162
|
]), 2)),
|
|
163
163
|
(v(), r("svg", {
|
|
164
164
|
class: h(["clear-svg", { "show-svg": m.value }]),
|
|
@@ -170,12 +170,12 @@ const ve = { class: "select-search" }, ce = ["readonly", "disabled"], de = ["tit
|
|
|
170
170
|
"aria-hidden": "true",
|
|
171
171
|
"fill-rule": "evenodd",
|
|
172
172
|
viewBox: "64 64 896 896",
|
|
173
|
-
onClick:
|
|
174
|
-
}, a[
|
|
175
|
-
|
|
173
|
+
onClick: B(X, ["stop"])
|
|
174
|
+
}, a[10] || (a[10] = [
|
|
175
|
+
w("path", { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z" }, null, -1)
|
|
176
176
|
]), 2))
|
|
177
177
|
], 32),
|
|
178
|
-
|
|
178
|
+
V(te, {
|
|
179
179
|
name: "slide-down",
|
|
180
180
|
"enter-from-class": "slide-down-enter",
|
|
181
181
|
"enter-active-class": "slide-down-enter",
|
|
@@ -184,47 +184,47 @@ const ve = { class: "select-search" }, ce = ["readonly", "disabled"], de = ["tit
|
|
|
184
184
|
"leave-active-class": "slide-down-leave slide-down-leave-active",
|
|
185
185
|
"leave-to-class": "slide-down-leave slide-down-leave-active"
|
|
186
186
|
}, {
|
|
187
|
-
default:
|
|
188
|
-
|
|
187
|
+
default: E(() => [
|
|
188
|
+
t.value && i.value && i.value.length ? (v(), r("div", {
|
|
189
189
|
key: 0,
|
|
190
190
|
class: "select-options-panel",
|
|
191
|
-
onClick:
|
|
192
|
-
onMouseenter: a[
|
|
193
|
-
onMouseleave: a[
|
|
191
|
+
onClick: B(g, ["stop"]),
|
|
192
|
+
onMouseenter: a[3] || (a[3] = (s) => c.value = !0),
|
|
193
|
+
onMouseleave: a[4] || (a[4] = (s) => c.value = !1)
|
|
194
194
|
}, [
|
|
195
|
-
|
|
195
|
+
V(N(re), oe({
|
|
196
196
|
ref_key: "scrollbarRef",
|
|
197
197
|
ref: b,
|
|
198
198
|
"content-style": { padding: "4px" },
|
|
199
|
-
style:
|
|
199
|
+
style: A.value
|
|
200
200
|
}, e.scrollbarProps), {
|
|
201
|
-
default:
|
|
202
|
-
(v(!0), r(ue, null, ne(i.value, (
|
|
203
|
-
key:
|
|
201
|
+
default: E(() => [
|
|
202
|
+
(v(!0), r(ue, null, ne(i.value, (s, L) => (v(), r("p", {
|
|
203
|
+
key: L,
|
|
204
204
|
class: h([
|
|
205
205
|
"select-option",
|
|
206
206
|
{
|
|
207
|
-
"option-hover": !
|
|
208
|
-
"option-selected":
|
|
209
|
-
"option-disabled":
|
|
207
|
+
"option-hover": !s.disabled && s[e.value] === n.value,
|
|
208
|
+
"option-selected": s[e.label] === u.value,
|
|
209
|
+
"option-disabled": s.disabled
|
|
210
210
|
}
|
|
211
211
|
]),
|
|
212
|
-
title:
|
|
213
|
-
onMouseenter: (
|
|
214
|
-
onClick:
|
|
215
|
-
},
|
|
212
|
+
title: s[e.label],
|
|
213
|
+
onMouseenter: (Z) => J(s[e.value], s.disabled),
|
|
214
|
+
onClick: B((Z) => s.disabled ? g() : Y(s[e.value], s[e.label], L), ["stop"])
|
|
215
|
+
}, D(s[e.label]), 43, fe))), 128))
|
|
216
216
|
]),
|
|
217
217
|
_: 1
|
|
218
218
|
}, 16, ["style"])
|
|
219
|
-
], 32)) :
|
|
219
|
+
], 32)) : t.value && i.value && !i.value.length ? (v(), r("div", {
|
|
220
220
|
key: 1,
|
|
221
221
|
class: "select-options-panel options-empty",
|
|
222
|
-
onClick:
|
|
223
|
-
onMouseenter: a[
|
|
224
|
-
onMouseleave: a[
|
|
222
|
+
onClick: B(g, ["stop"]),
|
|
223
|
+
onMouseenter: a[5] || (a[5] = (s) => c.value = !0),
|
|
224
|
+
onMouseleave: a[6] || (a[6] = (s) => c.value = !1)
|
|
225
225
|
}, [
|
|
226
|
-
|
|
227
|
-
], 32)) :
|
|
226
|
+
V(N(ie), { image: "outlined" })
|
|
227
|
+
], 32)) : T("", !0)
|
|
228
228
|
]),
|
|
229
229
|
_: 1
|
|
230
230
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.m-calendar[data-v-e106726d]{color:#000000e0;font-size:14px;line-height:1.57142857;list-style:none;background:#fff;border-radius:4px}.m-calendar .calendar-header-wrap[data-v-e106726d]{padding:12px 0}.m-calendar .calendar-header-wrap .calendar-header-content[data-v-e106726d]{margin-bottom:10px}.m-calendar .calendar-header-wrap .calendar-header-content[data-v-e106726d] svg{fill:currentColor}.m-calendar .calendar-header-wrap .calendar-header-actions[data-v-e106726d]{display:flex;justify-content:flex-end}.m-calendar .calendar-header-wrap .calendar-header-actions .calendar-month-select[data-v-e106726d],.m-calendar .calendar-header-wrap .calendar-header-actions .calendar-mode-radio[data-v-e106726d]{margin-left:8px}.m-calendar .calendar-display-wrap[data-v-e106726d]{background:#fff;outline:none}.m-calendar .calendar-display-wrap .calendar-date-panel[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel[data-v-e106726d]{display:flex;flex-direction:column;width:auto}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body[data-v-e106726d]{padding:8px 0}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table[data-v-e106726d]{display:table;margin:0;width:100%;table-layout:fixed;border-collapse:collapse}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table tr[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table tr[data-v-e106726d]{border:none;background-color:transparent}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table th[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table th[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table td[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table td[data-v-e106726d]{position:relative;min-width:24px;font-size:inherit;font-weight:400;padding:0;border:none}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table th[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table th[data-v-e106726d]{text-align:inherit;height:auto;line-height:18px;width:36px;color:#000000e0;vertical-align:middle;background:transparent}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d]{color:#00000040;cursor:pointer}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-e106726d]{position:relative;z-index:2;min-width:24px;line-height:24px}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell:hover:not(.date-cell-selected) .date-cell-inner[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell:hover:not(.date-cell-selected) .date-cell-inner[data-v-e106726d]{background:#0000000a}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-disabled[data-v-e106726d],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-disabled[data-v-e106726d]{color:#00000040;pointer-events:none}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-in-view[data-v-e106726d]:not(.date-cell-disabled):not(.date-cell-selected),.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-in-view[data-v-e106726d]:not(.date-cell-disabled):not(.date-cell-selected){color:#000000e0}.calendar-panel .calendar-header-wrap .calendar-header-actions .calendar-year-select[data-v-e106726d]{min-width:90px}.calendar-panel .calendar-header-wrap .calendar-header-actions .calendar-month-select[data-v-e106726d]{min-width:72px}.calendar-panel .calendar-display-wrap[data-v-e106726d]{width:100%;text-align:end}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table th[data-v-e106726d],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table th[data-v-e106726d]{padding-right:12px;padding-bottom:4px}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-e106726d],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-e106726d]{display:block;width:auto;height:auto;margin:0 4px;padding:4px 8px 0;border:0;border-top:2px solid rgba(5,5,5,.06);border-radius:0;transition:background .3s}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-value[data-v-e106726d],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-value[data-v-e106726d]{line-height:24px;transition:color .3s}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-content[data-v-e106726d],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-content[data-v-e106726d]{position:static;width:auto;height:86px;overflow-y:auto;color:#000000e0;line-height:1.57142857;text-align:start}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-e106726d],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-e106726d]{border-color:#1677ff}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner .date-value[data-v-e106726d],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner .date-value[data-v-e106726d]{color:#000000e0}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-e106726d],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-e106726d]{color:#1677ff;background:#e6f4ff}.calendar-card[data-v-e106726d]{width:300px;border:1px solid #d9d9d9;border-radius:4px}.calendar-card .calendar-header-wrap[data-v-e106726d]{padding-left:8px;padding-right:8px}.calendar-card .calendar-header-wrap .calendar-header-actions .calendar-year-select[data-v-e106726d]{min-width:86px}.calendar-card .calendar-header-wrap .calendar-header-actions .calendar-month-select[data-v-e106726d]{min-width:70px}.calendar-card .calendar-display-wrap[data-v-e106726d]{display:inline-flex;flex-direction:column;text-align:center;border-top:1px solid rgba(5,5,5,.06);border-radius:0 0 8px 8px}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d],.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d]{padding:4px 0}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d]:before{position:absolute;top:50%;left:0;right:0;z-index:1;height:24px;transform:translateY(-50%);transition:all .3s;content:"";pointer-events:none}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-e106726d],.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-e106726d]{display:inline-block;height:24px;border-radius:4px;transition:background .2s,color .2s}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-disabled[data-v-e106726d]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-disabled[data-v-e106726d]:before{background:#0000000a}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-e106726d]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-e106726d]:before{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;border:1px solid #1677ff;border-radius:4px;content:""}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-disabled.date-cell-today .date-cell-inner[data-v-e106726d]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-disabled.date-cell-today .date-cell-inner[data-v-e106726d]:before{border-color:#00000040}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-e106726d],.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-e106726d]{color:#fff;background:#1677ff}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d]{height:40px}.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-e106726d]{height:64px}.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-e106726d]{width:60px;padding:0 8px}
|
|
1
|
+
.m-calendar[data-v-6dc6f9bc]{color:#000000e0;font-size:14px;line-height:1.57142857;list-style:none;background:#fff;border-radius:4px}.m-calendar .calendar-header-wrap[data-v-6dc6f9bc]{padding:12px 0}.m-calendar .calendar-header-wrap .calendar-header-content[data-v-6dc6f9bc]{margin-bottom:10px}.m-calendar .calendar-header-wrap .calendar-header-content[data-v-6dc6f9bc] svg{fill:currentColor}.m-calendar .calendar-header-wrap .calendar-header-actions[data-v-6dc6f9bc]{display:flex;justify-content:flex-end}.m-calendar .calendar-header-wrap .calendar-header-actions .calendar-month-select[data-v-6dc6f9bc],.m-calendar .calendar-header-wrap .calendar-header-actions .calendar-mode-radio[data-v-6dc6f9bc]{margin-left:8px}.m-calendar .calendar-display-wrap[data-v-6dc6f9bc]{background:#fff;outline:none}.m-calendar .calendar-display-wrap .calendar-date-panel[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel[data-v-6dc6f9bc]{display:flex;flex-direction:column;width:auto}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body[data-v-6dc6f9bc]{padding:8px 0}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table[data-v-6dc6f9bc]{display:table;margin:0;width:100%;table-layout:fixed;border-collapse:collapse}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table tr[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table tr[data-v-6dc6f9bc]{border:none;background-color:transparent}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table th[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table th[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table td[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table td[data-v-6dc6f9bc]{position:relative;min-width:24px;font-size:inherit;font-weight:400;padding:0;border:none}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table th[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table th[data-v-6dc6f9bc]{text-align:inherit;height:auto;line-height:18px;width:36px;color:#000000e0;vertical-align:middle;background:transparent}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc]{color:#00000040;cursor:pointer}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-6dc6f9bc]{position:relative;z-index:2;min-width:24px;line-height:24px}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell:hover:not(.date-cell-selected) .date-cell-inner[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell:hover:not(.date-cell-selected) .date-cell-inner[data-v-6dc6f9bc]{background:#0000000a}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-disabled[data-v-6dc6f9bc],.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-disabled[data-v-6dc6f9bc]{color:#00000040;pointer-events:none}.m-calendar .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-in-view[data-v-6dc6f9bc]:not(.date-cell-disabled):not(.date-cell-selected),.m-calendar .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-in-view[data-v-6dc6f9bc]:not(.date-cell-disabled):not(.date-cell-selected){color:#000000e0}.calendar-panel .calendar-header-wrap .calendar-header-actions .calendar-year-select[data-v-6dc6f9bc]{min-width:90px}.calendar-panel .calendar-header-wrap .calendar-header-actions .calendar-month-select[data-v-6dc6f9bc]{min-width:72px}.calendar-panel .calendar-display-wrap[data-v-6dc6f9bc]{width:100%;text-align:end}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table th[data-v-6dc6f9bc],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table th[data-v-6dc6f9bc]{padding-right:12px;padding-bottom:4px}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-6dc6f9bc],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-6dc6f9bc]{display:block;width:auto;height:auto;margin:0 4px;padding:4px 8px 0;border:0;border-top:2px solid rgba(5,5,5,.06);border-radius:0;transition:background .3s}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-value[data-v-6dc6f9bc],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-value[data-v-6dc6f9bc]{line-height:24px;transition:color .3s}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-content[data-v-6dc6f9bc],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner .date-content[data-v-6dc6f9bc]{position:static;width:auto;height:86px;overflow-y:auto;color:#000000e0;line-height:1.57142857;text-align:start}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-6dc6f9bc],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-6dc6f9bc]{border-color:var(--calendar-primary-color)}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner .date-value[data-v-6dc6f9bc],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner .date-value[data-v-6dc6f9bc]{color:#000000e0}.calendar-panel .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-6dc6f9bc],.calendar-panel .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-6dc6f9bc]{color:var(--calendar-primary-color);background:var(--calendar-panel-primary-bg-color)}.calendar-card[data-v-6dc6f9bc]{width:300px;border:1px solid #d9d9d9;border-radius:4px}.calendar-card .calendar-header-wrap[data-v-6dc6f9bc]{padding-left:8px;padding-right:8px}.calendar-card .calendar-header-wrap .calendar-header-actions .calendar-year-select[data-v-6dc6f9bc]{min-width:86px}.calendar-card .calendar-header-wrap .calendar-header-actions .calendar-month-select[data-v-6dc6f9bc]{min-width:70px}.calendar-card .calendar-display-wrap[data-v-6dc6f9bc]{display:inline-flex;flex-direction:column;text-align:center;border-top:1px solid rgba(5,5,5,.06);border-radius:0 0 8px 8px}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc],.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc]{padding:4px 0}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc]:before{position:absolute;top:50%;left:0;right:0;z-index:1;height:24px;transform:translateY(-50%);transition:all .3s;content:"";pointer-events:none}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-6dc6f9bc],.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-6dc6f9bc]{display:inline-block;height:24px;border-radius:4px;transition:background .2s,color .2s}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-disabled[data-v-6dc6f9bc]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-disabled[data-v-6dc6f9bc]:before{background:#0000000a}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-6dc6f9bc]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-today .date-cell-inner[data-v-6dc6f9bc]:before{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;border:1px solid var(--calendar-primary-color);border-radius:4px;content:""}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-disabled.date-cell-today .date-cell-inner[data-v-6dc6f9bc]:before,.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-disabled.date-cell-today .date-cell-inner[data-v-6dc6f9bc]:before{border-color:#00000040}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-6dc6f9bc],.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .date-cell-selected .date-cell-inner[data-v-6dc6f9bc]{color:#fff;background:var(--calendar-card-primary-bg-color)}.calendar-card .calendar-display-wrap .calendar-date-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc]{height:40px}.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell[data-v-6dc6f9bc]{height:64px}.calendar-card .calendar-display-wrap .calendar-month-panel .calendar-body .calendar-table .calendar-date-cell .date-cell-inner[data-v-6dc6f9bc]{width:60px;padding:0 8px}
|
|
@@ -4,6 +4,9 @@ export interface Props {
|
|
|
4
4
|
display?: 'panel' | 'card';
|
|
5
5
|
mode?: 'month' | 'year';
|
|
6
6
|
header?: string;
|
|
7
|
+
yearSelectProps?: object;
|
|
8
|
+
monthSelectProps?: object;
|
|
9
|
+
modeRadioProps?: object;
|
|
7
10
|
startDayOfWeek?: DayOfWeek;
|
|
8
11
|
dateStrip?: boolean;
|
|
9
12
|
dateFormat?: (date: number, timestamp: number) => string;
|
|
@@ -102,6 +105,9 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
102
105
|
mode: "month" | "year";
|
|
103
106
|
value: string | number;
|
|
104
107
|
display: "panel" | "card";
|
|
108
|
+
yearSelectProps: object;
|
|
109
|
+
monthSelectProps: object;
|
|
110
|
+
modeRadioProps: object;
|
|
105
111
|
startDayOfWeek: DayOfWeek;
|
|
106
112
|
dateStrip: boolean;
|
|
107
113
|
dateFormat: (date: number, timestamp: number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Calendar.vue2.cjs");;/* empty css */const t=require("../_virtual/_plugin-vue_export-helper.cjs"),u=t.default(e.default,[["__scopeId","data-v-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Calendar.vue2.cjs");;/* empty css */const t=require("../_virtual/_plugin-vue_export-helper.cjs"),u=t.default(e.default,[["__scopeId","data-v-6dc6f9bc"]]);exports.default=u;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("date-fns"),O=require("../select/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("date-fns"),O=require("../select/index.cjs"),Q=require("../radio/index.cjs"),X=require("../utils/index.cjs"),Z={class:"calendar-header-wrap"},x={key:0,class:"calendar-header-content"},I={class:"calendar-header-actions"},ee={tabindex:"0",class:"calendar-display-wrap"},te={key:0,class:"calendar-date-panel"},ae={class:"calendar-body"},le={class:"calendar-table"},oe=["title","onClick"],ne={class:"date-cell-inner"},re={class:"date-value"},se={class:"date-content"},ue={key:1,class:"calendar-month-panel"},de={class:"calendar-body"},ce={class:"calendar-table"},ie=["title","onClick"],me={class:"date-cell-inner"},ve={class:"date-value"},pe={class:"date-content"},fe=e.defineComponent({__name:"Calendar",props:{display:{default:"panel"},mode:{default:"month"},header:{default:void 0},yearSelectProps:{default:()=>({})},monthSelectProps:{default:()=>({})},modeRadioProps:{default:()=>({})},startDayOfWeek:{default:0},dateStrip:{type:Boolean,default:!0},dateFormat:{type:Function,default:void 0},weekFormat:{type:Function,default:void 0},monthFormat:{type:Function,default:void 0},disabledDate:{type:Function,default:void 0},valueFormat:{default:void 0},value:{default:void 0}},emits:["update:value","change","panelChange","select"],setup(S,{emit:E}){const n=S,D=e.ref(Date.now()),M=e.ref([]),C=e.ref(P()),B=e.ref([{label:"月",value:"month"},{label:"年",value:"year"}]),c=e.ref(a.getYear(D.value)),i=e.ref(a.getMonth(D.value)+1),m=e.ref(n.mode),g=e.ref([]),u=e.ref(),V=e.ref([]),N=X.useSlotsExist(["header"]),p=E,w=e.computed(()=>{const t=["一","二","三","四","五","六","日"],l=[];l.push(t[n.startDayOfWeek]);let r=(n.startDayOfWeek+1)%7;for(;r!==n.startDayOfWeek;)l.push(t[r]),r=(r+1)%7;return l}),v=e.computed(()=>{if(u.value)return typeof u.value=="string"?a.parse(u.value,n.valueFormat,new Date).getTime():u.value}),F=e.computed(()=>new Date(c.value,i.value-1,1).getTime()),_=e.computed(()=>N.header||n.header);e.watch(v,t=>{t&&(c.value=a.getYear(t),i.value=a.getMonth(t)+1)},{immediate:!0}),e.watch(()=>n.mode,t=>{m.value=t}),e.watch(()=>[n.startDayOfWeek,n.dateStrip,i.value,c.value],()=>{g.value=j()},{immediate:!0,deep:!0}),e.watch(c,()=>{M.value=T(),V.value=L()},{immediate:!0}),e.watch(()=>[n.valueFormat,n.value],()=>{n.value&&(n.valueFormat===void 0||n.valueFormat==="T"?u.value=Number(a.format(a.startOfDay(n.value).getTime(),n.valueFormat||"T")):u.value=a.format(a.startOfDay(n.value).getTime(),n.valueFormat))},{deep:!0,immediate:!0});function T(){const t=[],l=c.value-10,r=c.value+10;for(let s=l;s<r;s++)t.push({label:`${s}年`,value:s});return t}function P(){const t=[];for(let l=1;l<=12;l++)t.push({label:`${l}月`,value:l});return t}function y(t,l,r){return{type:"date",dateObject:{date:a.getDate(t),month:a.getMonth(t),year:a.getYear(t)},timestamp:a.getTime(t),inCurrentMonth:a.isSameMonth(t,l),isCurrentDate:a.isSameDay(r,t)}}function $(t,l,r,s=!1){const o=a.getMonth(t);let d=a.getTime(a.startOfMonth(t)),h=a.getTime(a.addDays(d,-1));const f=[];let b=!s;for(;a.getDay(h)!==r||b;)f.unshift(y(h,t,l)),h=a.getTime(a.addDays(h,-1)),b=!1;for(;a.getMonth(d)===o;)f.push(y(d,t,l)),d=a.getTime(a.addDays(d,1));const K=s?f.length<=28?28:f.length<=35?35:42:42;for(;f.length<K;)f.push(y(d,t,l)),d=a.getTime(a.addDays(d,1));return f}function j(){const t=$(F.value,Date.now(),n.startDayOfWeek,n.dateStrip),l=7,r=t.length/l,s=[];for(let o=0;o<r;o++)s.push(t.slice(o*l,(o+1)*l));return s}function Y(t,l){return{type:"month",monthObject:{month:a.getMonth(t),year:a.getYear(t)},timestamp:a.getTime(t),isCurrent:a.isSameMonth(l,t)}}function z(t,l){const r=[],s=a.startOfYear(t);for(let o=0;o<12;o++)r.push(Y(a.getTime(a.addMonths(s,o)),l));return r}function L(){const t=z(F.value,Date.now()),l=3,r=t.length/l,s=[];for(let o=0;o<r;o++)s.push(t.slice(o*l,(o+1)*l));return s}function W(t){return a.format(t.timestamp,"yyyy-MM-dd")}function q(t){return a.format(t.timestamp,"yyyy-MM")}function U(t,l){return n.dateFormat===void 0?`${t}`:n.dateFormat(t,l)}function R(t,l,r){return n.weekFormat===void 0?t:n.weekFormat(t,l,r)}function H(t,l){return n.monthFormat===void 0?`${t}月`:n.monthFormat(t,l)}function A(t){v.value!==t.timestamp&&(t.dateObject.month+1!==i.value&&(i.value=t.dateObject.month+1),n.valueFormat===void 0||n.valueFormat==="T"?u.value=t.timestamp:u.value=a.format(t.timestamp,n.valueFormat),p("update:value",u.value),p("select",u.value,"date"),p("change",u.value,t.dateObject))}function G(){if(u.value){if(typeof u.value=="string"){const t=a.parse(u.value,n.valueFormat,new Date).getTime();return a.startOfMonth(t).getTime()}return a.startOfMonth(u.value).getTime()}}function J(t){if(G()!==t.timestamp){if(i.value=t.monthObject.month+1,u.value){const l=t.monthObject.year-a.getYear(v.value),r=t.monthObject.month-a.getMonth(v.value),s=a.addMonths(a.addYears(v.value,l),r);n.valueFormat===void 0||n.valueFormat==="T"?u.value=Number(a.format(s,n.valueFormat||"T")):u.value=a.format(s,n.valueFormat)}p("update:value",u.value),p("select",u.value,"month"),p("change",u.value,t.monthObject)}}function k(){m.value==="month"?p("panelChange",u.value,{year:c.value,month:i.value},m.value):p("panelChange",u.value,{year:c.value},m.value)}return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["m-calendar",`calendar-${t.display}`]),style:`
|
|
2
|
+
--calendar-primary-color: #1677ff;
|
|
3
|
+
--calendar-panel-primary-bg-color: #e6f4ff;
|
|
4
|
+
--calendar-card-primary-bg-color: #1677ff;
|
|
5
|
+
`},[e.createElementVNode("div",Z,[_.value?(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(t.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(t.header),1)],!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",I,[e.createVNode(e.unref(O.default),e.mergeProps({class:"calendar-year-select",size:t.display==="card"?"small":"middle",options:M.value,"max-display":8,modelValue:c.value,"onUpdate:modelValue":l[0]||(l[0]=r=>c.value=r),onChange:k},t.yearSelectProps),null,16,["size","options","modelValue"]),m.value==="month"?(e.openBlock(),e.createBlock(e.unref(O.default),e.mergeProps({key:0,class:"calendar-month-select",size:t.display==="card"?"small":"middle",options:C.value,"max-display":8,modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=r=>i.value=r),onChange:k},t.monthSelectProps),null,16,["size","options","modelValue"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Q.default),e.mergeProps({class:"calendar-mode-radio","button-size":t.display==="card"?"small":"middle",options:B.value,value:m.value,"onUpdate:value":l[2]||(l[2]=r=>m.value=r),button:"",onChange:k},t.modeRadioProps),null,16,["button-size","options","value"])])]),e.createElementVNode("div",ee,[m.value==="month"?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",ae,[e.createElementVNode("table",le,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(r,s)=>(e.openBlock(),e.createElementBlock("th",{key:s},[e.renderSlot(t.$slots,"week",{defaultWeek:r,week:s,timestamp:g.value[0][s].timestamp},()=>[e.createTextVNode(e.toDisplayString(R(r,s,g.value[0][s].timestamp)),1)],!0)]))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(r,s)=>(e.openBlock(),e.createElementBlock("tr",{key:s},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,d)=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass(["calendar-date-cell",{"date-cell-disabled":t.disabledDate&&t.disabledDate(o.timestamp),"date-cell-in-view":o.inCurrentMonth,"date-cell-today":o.isCurrentDate,"date-cell-selected":v.value&&v.value===o.timestamp}]),key:d,title:W(o),onClick:h=>A(o)},[e.createElementVNode("div",ne,[e.createElementVNode("div",re,[e.renderSlot(t.$slots,"dateValue",e.mergeProps({ref_for:!0},o),()=>[e.createTextVNode(e.toDisplayString(U(o.dateObject.date,o.timestamp)),1)],!0)]),e.createElementVNode("div",se,[e.renderSlot(t.$slots,"dateContent",e.mergeProps({ref_for:!0},o),void 0,!0)])])],10,oe))),128))]))),128))])])])])):e.createCommentVNode("",!0),m.value==="year"?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",de,[e.createElementVNode("table",ce,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(r,s)=>(e.openBlock(),e.createElementBlock("tr",{key:s},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,d)=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass(["calendar-date-cell date-cell-in-view",{"date-cell-today":o.isCurrent,"date-cell-selected":v.value&&e.unref(a.startOfMonth)(v.value).getTime()===o.timestamp}]),key:d,title:q(o),onClick:h=>J(o)},[e.createElementVNode("div",me,[e.createElementVNode("div",ve,[e.renderSlot(t.$slots,"monthValue",e.mergeProps({ref_for:!0},o),()=>[e.createTextVNode(e.toDisplayString(H(o.monthObject.month+1,o.timestamp)),1)],!0)]),e.createElementVNode("div",pe,[e.renderSlot(t.$slots,"monthContent",e.mergeProps({ref_for:!0},o),void 0,!0)])])],10,ie))),128))]))),128))])])])])):e.createCommentVNode("",!0)])],2))}});exports.default=fe;
|
package/lib/calendar/index.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ declare const _default: {
|
|
|
15
15
|
mode: "month" | "year";
|
|
16
16
|
value: string | number;
|
|
17
17
|
display: "panel" | "card";
|
|
18
|
+
yearSelectProps: object;
|
|
19
|
+
monthSelectProps: object;
|
|
20
|
+
modeRadioProps: object;
|
|
18
21
|
startDayOfWeek: import('./Calendar').DayOfWeek;
|
|
19
22
|
dateStrip: boolean;
|
|
20
23
|
dateFormat: (date: number, timestamp: number) => string;
|
|
@@ -39,6 +42,9 @@ declare const _default: {
|
|
|
39
42
|
mode: "month" | "year";
|
|
40
43
|
value: string | number;
|
|
41
44
|
display: "panel" | "card";
|
|
45
|
+
yearSelectProps: object;
|
|
46
|
+
monthSelectProps: object;
|
|
47
|
+
modeRadioProps: object;
|
|
42
48
|
startDayOfWeek: import('./Calendar').DayOfWeek;
|
|
43
49
|
dateStrip: boolean;
|
|
44
50
|
dateFormat: (date: number, timestamp: number) => string;
|
|
@@ -65,6 +71,9 @@ declare const _default: {
|
|
|
65
71
|
mode: "month" | "year";
|
|
66
72
|
value: string | number;
|
|
67
73
|
display: "panel" | "card";
|
|
74
|
+
yearSelectProps: object;
|
|
75
|
+
monthSelectProps: object;
|
|
76
|
+
modeRadioProps: object;
|
|
68
77
|
startDayOfWeek: import('./Calendar').DayOfWeek;
|
|
69
78
|
dateStrip: boolean;
|
|
70
79
|
dateFormat: (date: number, timestamp: number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.color-picker-panel[data-v-
|
|
1
|
+
.color-picker-panel[data-v-b199915c]{padding:12px}.color-picker-panel .color-picker-pallete[data-v-b199915c]{height:180px;position:relative;margin-bottom:8px;cursor:crosshair}.color-picker-panel .color-picker-pallete .color-picker-pallete-layer[data-v-b199915c]{position:absolute;left:0;right:0;top:0;bottom:0}.color-picker-panel .color-picker-pallete .pallete-layer-shadowed[data-v-b199915c]{box-shadow:inset 0 0 2px #0000003d}.color-picker-panel .color-picker-preview[data-v-b199915c]{display:flex}.color-picker-panel .color-picker-preview .color-picker-preview-sliders[data-v-b199915c]{flex:1 0 auto}.color-picker-panel .color-picker-preview .color-picker-preview-sliders .color-picker-slider[data-v-b199915c]{margin-bottom:8px;position:relative}.color-picker-panel .color-picker-preview .color-picker-preview-sliders .color-picker-slider[data-v-b199915c]:after{content:"";position:absolute;border-radius:inherit;left:0;right:0;top:0;bottom:0;box-shadow:inset 0 0 2px #0000003d;pointer-events:none}.color-picker-panel .color-picker-preview .color-picker-preview-sliders .color-picker-slider .color-picker-checkboard[data-v-b199915c]{background:#fff;position:absolute;left:0;right:0;top:0;bottom:0}.color-picker-panel .color-picker-preview .color-picker-preview-sliders .color-picker-slider .color-picker-checkboard[data-v-b199915c]:after{background-image:linear-gradient(45deg,#ddd 25%,#0000 25%),linear-gradient(-45deg,#ddd 25%,#0000 25%),linear-gradient(45deg,#0000 75%,#ddd 75%),linear-gradient(-45deg,#0000 75%,#ddd 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0px;background-repeat:repeat;content:"";position:absolute;left:0;right:0;top:0;bottom:0}.color-picker-panel .color-picker-preview .color-picker-preview-sliders .color-picker-slider .color-picker-slider-image[data-v-b199915c]{position:absolute;left:0;right:0;top:0;bottom:0}.color-picker-panel .color-picker-preview .color-picker-preview-circle[data-v-b199915c]{position:relative;height:30px;width:30px;margin:0 0 8px 6px;border-radius:50%;box-shadow:#00000026 0 0 0 1px inset;overflow:hidden}.color-picker-panel .color-picker-preview .color-picker-preview-circle .color-picker-circle-fill[data-v-b199915c]{display:block;width:30px;height:30px}.color-picker-panel .color-picker-preview .color-picker-preview-circle .color-picker-circle-input[data-v-b199915c]{position:absolute;top:0;left:0;width:30px;height:30px;opacity:0;z-index:1}.color-picker-panel .color-picker-handle[data-v-b199915c]{z-index:1;box-shadow:0 0 2px #00000073;position:absolute;background-color:#fff;overflow:hidden}.color-picker-panel .color-picker-handle .color-picker-handle-fill[data-v-b199915c]{border:2px solid white}.color-picker-panel .color-picker-input[data-v-b199915c]{display:flex;align-items:center}.color-picker-panel .color-picker-input .color-picker-input-mode[data-v-b199915c]{width:72px;text-align:center}.color-picker-panel .color-picker-input .color-picker-input-group[data-v-b199915c]{display:inline-flex;width:100%;flex-wrap:nowrap;vertical-align:bottom}.color-picker-panel .color-picker-input .color-picker-input-group[data-v-b199915c] .m-input{flex-grow:1;flex-basis:0}.color-picker-panel .color-picker-input .color-picker-input-group[data-v-b199915c] .m-input:not(:first-child){margin-left:-1px}.color-picker-panel .color-picker-input .color-picker-input-group[data-v-b199915c] .m-input:not(:first-child) .input-wrap{border-top-left-radius:0;border-bottom-left-radius:0}.color-picker-panel .color-picker-input .color-picker-input-group[data-v-b199915c] .m-input:not(:last-child) .input-wrap{border-top-right-radius:0;border-bottom-right-radius:0}.color-picker-panel .color-picker-input .color-picker-input-group[data-v-b199915c] .m-input .input-wrap{padding:1px 4px}.color-picker-panel .color-picker-input .color-picker-input-group[data-v-b199915c] .m-input .input-item{text-align:center}.color-picker-panel .color-picker-swatches[data-v-b199915c]{display:flex;gap:8px;flex-wrap:wrap;position:relative;margin-top:10px}.color-picker-panel .color-picker-swatches .color-picker-swatch[data-v-b199915c]{width:18px;height:18px;background-image:linear-gradient(45deg,#ddd 25%,#0000 25%),linear-gradient(-45deg,#ddd 25%,#0000 25%),linear-gradient(45deg,#0000 75%,#ddd 75%),linear-gradient(-45deg,#0000 75%,#ddd 75%);background-size:8px 8px;background-position:0px 0,0px 4px,4px -4px,-4px 0px;background-repeat:repeat}.color-picker-panel .color-picker-swatches .color-picker-swatch .color-picker-swatch-fill[data-v-b199915c]{position:relative;width:100%;height:100%;border-radius:3px;box-shadow:#00000026 0 0 0 1px inset;cursor:pointer}.panel-with-actions[data-v-b199915c]{padding-bottom:8px}.color-picker-actions[data-v-b199915c]{display:flex;gap:8px;border-top:1px solid rgba(5,5,5,.06);padding:8px 12px;justify-content:flex-end}.color-picker-footer[data-v-b199915c]{border-top:1px solid rgba(5,5,5,.06);padding:8px 12px}.color-picker-display[data-v-b199915c]{display:inline-block;width:var(--color-picker-width);height:var(--color-picker-height);border-radius:4px;position:relative;outline:none}.color-picker-display:not(.color-picker-disabled):hover .color-picker-wrap[data-v-b199915c]{border-color:var(--color-picker-primary-color-hover)}.color-picker-display:not(.color-picker-disabled):focus .color-picker-wrap[data-v-b199915c]{border-color:var(--color-picker-primary-color-focus);box-shadow:0 0 0 2px var(--color-picker-primary-shadow-color)}.color-picker-display .color-picker-wrap[data-v-b199915c]{height:100%;cursor:pointer;border:1px solid #d9d9d9;border-radius:4px;transition:all .2s cubic-bezier(.4,0,.2,1)}.color-picker-display .color-picker-wrap .color-picker-fill[data-v-b199915c]{position:absolute;left:4px;right:4px;top:4px;bottom:4px;display:flex;align-items:center;justify-content:center}.color-picker-display .color-picker-wrap .color-picker-fill .color-picker-checkboard[data-v-b199915c]{width:100%;height:100%;position:relative;background:#fff;position:absolute;left:0;right:0;top:0;bottom:0}.color-picker-display .color-picker-wrap .color-picker-fill .color-picker-checkboard[data-v-b199915c]:after{background-image:linear-gradient(45deg,#ddd 25%,#0000 25%),linear-gradient(-45deg,#ddd 25%,#0000 25%),linear-gradient(45deg,#0000 75%,#ddd 75%),linear-gradient(-45deg,#0000 75%,#ddd 75%);background-size:calc(var(--color-picker-block-size) * 2) calc(var(--color-picker-block-size) * 2);background-position:0 0,0 var(--color-picker-block-size),var(--color-picker-block-size) calc(-1 * var(--color-picker-block-size)),calc(-1 * var(--color-picker-block-size)) 0px;background-repeat:repeat;content:"";position:absolute;left:0;right:0;top:0;bottom:0}.color-picker-display .color-picker-wrap .color-picker-fill .color-picker-value[data-v-b199915c]{white-space:nowrap;position:relative;font-size:14px;line-height:1.71428571}.color-picker-small .color-picker-wrap .color-picker-fill[data-v-b199915c]{left:3px;right:3px;top:3px;bottom:3px}.color-picker-small .color-picker-wrap .color-picker-fill .color-picker-value[data-v-b199915c]{line-height:1.28571429}.color-picker-large .color-picker-wrap .color-picker-fill[data-v-b199915c]{left:5px;right:5px;top:5px;bottom:5px}.color-picker-large .color-picker-wrap .color-picker-fill .color-picker-value[data-v-b199915c]{font-size:16px;line-height:1.875}.color-picker-disabled[data-v-b199915c]{cursor:not-allowed}
|
|
@@ -2,8 +2,10 @@ import { CSSProperties } from 'vue';
|
|
|
2
2
|
export type ColorPickerMode = 'rgb' | 'hsl' | 'hsv' | 'hex';
|
|
3
3
|
export type ColorPickerAction = 'confirm' | 'clear';
|
|
4
4
|
export interface Props {
|
|
5
|
+
width?: string | number;
|
|
5
6
|
label?: (color: string) => string;
|
|
6
7
|
tooltipStyle?: CSSProperties;
|
|
8
|
+
inputProps?: object;
|
|
7
9
|
showAlpha?: boolean;
|
|
8
10
|
showPreview?: boolean;
|
|
9
11
|
size?: 'small' | 'middle' | 'large';
|
|
@@ -173,9 +175,11 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
173
175
|
footer: string;
|
|
174
176
|
label: (color: string) => string;
|
|
175
177
|
actions: ColorPickerAction[];
|
|
178
|
+
width: string | number;
|
|
176
179
|
tooltipStyle: CSSProperties;
|
|
177
180
|
value: string;
|
|
178
181
|
disabled: boolean;
|
|
182
|
+
inputProps: object;
|
|
179
183
|
showAlpha: boolean;
|
|
180
184
|
showPreview: boolean;
|
|
181
185
|
modes: ColorPickerMode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ColorPicker.vue2.cjs");;/* empty css */const r=require("../_virtual/_plugin-vue_export-helper.cjs"),t=r.default(e.default,[["__scopeId","data-v-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./ColorPicker.vue2.cjs");;/* empty css */const r=require("../_virtual/_plugin-vue_export-helper.cjs"),t=r.default(e.default,[["__scopeId","data-v-b199915c"]]);exports.default=t;
|