@farris/ui-vue 1.0.0-beta.2 → 1.0.0-beta.3
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/accordion/index.esm.js +93 -0
- package/accordion/index.umd.js +1 -0
- package/accordion/package.json +7 -0
- package/accordion/style.css +1 -0
- package/avatar/index.esm.js +94 -0
- package/avatar/index.umd.js +1 -0
- package/avatar/package.json +7 -0
- package/avatar/style.css +1 -0
- package/button/index.esm.js +206 -0
- package/button/index.umd.js +1 -0
- package/button/package.json +7 -0
- package/button-edit/index.esm.js +300 -0
- package/button-edit/index.umd.js +1 -0
- package/button-edit/package.json +7 -0
- package/checkbox/index.esm.js +97 -0
- package/checkbox/index.umd.js +1 -0
- package/checkbox/package.json +7 -0
- package/combo-list/index.esm.js +457 -0
- package/combo-list/index.umd.js +1 -0
- package/combo-list/package.json +7 -0
- package/data-grid/index.esm.js +1536 -0
- package/data-grid/index.umd.js +1 -0
- package/data-grid/package.json +7 -0
- package/data-grid/style.css +1 -0
- package/date-picker/index.esm.js +1479 -0
- package/date-picker/index.umd.js +1 -0
- package/date-picker/package.json +7 -0
- package/date-picker/style.css +1 -0
- package/list-view/index.esm.js +144 -0
- package/list-view/index.umd.js +1 -0
- package/list-view/package.json +7 -0
- package/list-view/style.css +1 -0
- package/message-box/index.esm.js +499 -0
- package/message-box/index.umd.js +1 -0
- package/message-box/package.json +7 -0
- package/modal/index.esm.js +165 -0
- package/modal/index.umd.js +1 -0
- package/modal/package.json +7 -0
- package/notify/index.esm.js +187 -0
- package/notify/index.umd.js +1 -0
- package/notify/package.json +7 -0
- package/notify/style.css +1 -0
- package/package.json +4 -4
- package/pagination/index.esm.js +334 -0
- package/pagination/index.umd.js +1 -0
- package/pagination/package.json +7 -0
- package/pagination/style.css +1 -0
- package/popover/index.esm.js +83 -0
- package/popover/index.umd.js +1 -0
- package/popover/package.json +7 -0
- package/popover/style.css +1 -0
- package/radio-group/index.esm.js +79 -0
- package/radio-group/index.umd.js +1 -0
- package/radio-group/package.json +7 -0
- package/section/index.esm.js +70 -0
- package/section/index.umd.js +1 -0
- package/section/package.json +7 -0
- package/switch/index.esm.js +78 -0
- package/switch/index.umd.js +1 -0
- package/switch/package.json +7 -0
- package/tabs/index.esm.js +385 -0
- package/tabs/index.umd.js +1 -0
- package/tabs/package.json +7 -0
- package/tabs/style.css +1 -0
- package/text/index.esm.js +33 -0
- package/text/index.umd.js +1 -0
- package/text/package.json +7 -0
- package/tooltip/index.esm.js +195 -0
- package/tooltip/index.umd.js +1 -0
- package/tooltip/package.json +7 -0
- package/tooltip/style.css +1 -0
- /package/{src/index.esm.js → farris.all.esm.js} +0 -0
- /package/{src/index.umd.js → farris.all.umd.js} +0 -0
- /package/{src/style.css → style.css} +0 -0
|
@@ -0,0 +1,1479 @@
|
|
|
1
|
+
import { defineComponent as G, ref as o, computed as O, watch as J, createVNode as v, Fragment as se, createTextVNode as ne, mergeProps as ee, Teleport as dt, withDirectives as ft, vShow as yt, resolveComponent as vt } from "vue";
|
|
2
|
+
const ae = ["Sun.", "Mon.", "Tue.", "Wed.", "Thur", "Fri.", "Sat."];
|
|
3
|
+
var q = /* @__PURE__ */ ((e) => (e[e.previous = 1] = "previous", e[e.current = 2] = "current", e[e.next = 3] = "next", e))(q || {});
|
|
4
|
+
const ht = {
|
|
5
|
+
dates: { Type: Array, default: [] },
|
|
6
|
+
daysInWeek: { Type: Array, default: ae },
|
|
7
|
+
enableKeyboadNavigate: { Type: Boolean, default: !0 },
|
|
8
|
+
enableMarkCurrent: { Type: Boolean, default: !0 },
|
|
9
|
+
enablePeriod: { Type: Boolean, default: !1 },
|
|
10
|
+
firstDayOfTheWeek: { Type: Boolean, default: "Sun." },
|
|
11
|
+
selected: { Type: Object, default: null },
|
|
12
|
+
selectedPeriod: { Type: Object, default: null },
|
|
13
|
+
selectedWeek: { Type: Object, default: null },
|
|
14
|
+
selectMode: { Type: String, default: "day" },
|
|
15
|
+
showWeekNumber: { Type: Boolean, default: !1 },
|
|
16
|
+
weekTitle: { Type: String, default: "Week" }
|
|
17
|
+
};
|
|
18
|
+
var H = /* @__PURE__ */ ((e) => (e[e.enter = 13] = "enter", e[e.esc = 27] = "esc", e[e.space = 32] = "space", e[e.leftArrow = 37] = "leftArrow", e[e.upArrow = 38] = "upArrow", e[e.rightArrow = 39] = "rightArrow", e[e.downArrow = 40] = "downArrow", e[e.tab = 9] = "tab", e[e.shift = 16] = "shift", e))(H || {});
|
|
19
|
+
function ie() {
|
|
20
|
+
function e(l) {
|
|
21
|
+
const s = l.key || l.keyCode;
|
|
22
|
+
return s === "Enter" || s === 13 ? 13 : s === "Escape" || s === 27 ? 27 : s === " " || s === 32 ? 32 : s === "ArrowLeft" || s === 37 ? 37 : s === "ArrowUp" || s === 38 ? 38 : s === "ArrowRight" || s === 39 ? 39 : s === "ArrowDown" || s === 40 ? 40 : s === "Tab" || s === 9 ? 9 : s === "Shift" || s === 16 ? 16 : -1;
|
|
23
|
+
}
|
|
24
|
+
return { getKeyCodeFromEvent: e };
|
|
25
|
+
}
|
|
26
|
+
function Z() {
|
|
27
|
+
function e() {
|
|
28
|
+
return { year: 0, month: 0, day: 0 };
|
|
29
|
+
}
|
|
30
|
+
function l(t) {
|
|
31
|
+
return new Date(
|
|
32
|
+
t.year || 0,
|
|
33
|
+
t.month ? t.month - 1 : 0,
|
|
34
|
+
t.day || 0,
|
|
35
|
+
t.hour ? t.hour : 0,
|
|
36
|
+
t.minute ? t.minute : 0,
|
|
37
|
+
t.second ? t.second : 0,
|
|
38
|
+
0
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
function s(t) {
|
|
42
|
+
const f = new Date();
|
|
43
|
+
return t.year || (t.year = f.getFullYear()), t.month || (t.month = f.getMonth() + 1), t.day || (t.day = 1), new Date(
|
|
44
|
+
t.year,
|
|
45
|
+
t.month - 1,
|
|
46
|
+
t.day,
|
|
47
|
+
t.hour ? t.hour : 0,
|
|
48
|
+
t.minute ? t.minute : 0,
|
|
49
|
+
t.second ? t.second : 0,
|
|
50
|
+
0
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function k(t) {
|
|
54
|
+
return new Date(
|
|
55
|
+
t.year || 1,
|
|
56
|
+
(t.month || 1) - 1,
|
|
57
|
+
t.day,
|
|
58
|
+
t.hour ? t.hour : 0,
|
|
59
|
+
t.minute ? t.minute : 0,
|
|
60
|
+
t.second ? t.second : 0,
|
|
61
|
+
0
|
|
62
|
+
).getDay();
|
|
63
|
+
}
|
|
64
|
+
function i(t) {
|
|
65
|
+
return ae.indexOf(t);
|
|
66
|
+
}
|
|
67
|
+
function r(t) {
|
|
68
|
+
return l(t).getTime();
|
|
69
|
+
}
|
|
70
|
+
function h(t) {
|
|
71
|
+
return Math.round(r(t) / 1e3);
|
|
72
|
+
}
|
|
73
|
+
function c(t, f, n) {
|
|
74
|
+
const u = r(f), y = r(n), b = r(t);
|
|
75
|
+
return y - b > b - u ? f : n;
|
|
76
|
+
}
|
|
77
|
+
function d() {
|
|
78
|
+
const t = new Date();
|
|
79
|
+
return {
|
|
80
|
+
year: t.getFullYear(),
|
|
81
|
+
month: t.getMonth() + 1,
|
|
82
|
+
day: t.getDate(),
|
|
83
|
+
hour: t.getHours(),
|
|
84
|
+
minute: t.getMinutes(),
|
|
85
|
+
second: t.getSeconds()
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return { emptyDate: e, getDate: l, getDate2: s, getDayNumber: k, getEpocTime: h, getNearDate: c, getWeekdayIndex: i, getTimeInMilliseconds: r, getToday: d };
|
|
89
|
+
}
|
|
90
|
+
function te() {
|
|
91
|
+
const { getTimeInMilliseconds: e } = Z();
|
|
92
|
+
function l(n) {
|
|
93
|
+
return n && n.year !== 0 && n.month !== 0 && n.day !== 0;
|
|
94
|
+
}
|
|
95
|
+
function s(n) {
|
|
96
|
+
return n && n.year !== 0 && n.month !== 0;
|
|
97
|
+
}
|
|
98
|
+
function k(n) {
|
|
99
|
+
return n && n.year !== 0;
|
|
100
|
+
}
|
|
101
|
+
function i(n, u) {
|
|
102
|
+
return e(n) < e(u);
|
|
103
|
+
}
|
|
104
|
+
function r(n, u) {
|
|
105
|
+
return e(n) <= e(u);
|
|
106
|
+
}
|
|
107
|
+
function h(n, u) {
|
|
108
|
+
return e(n) === e(u);
|
|
109
|
+
}
|
|
110
|
+
function c(n, u) {
|
|
111
|
+
const y = e(u);
|
|
112
|
+
return e(n.from) === y || e(n.to) === y;
|
|
113
|
+
}
|
|
114
|
+
function d(n, u) {
|
|
115
|
+
return !u || !l(u.to) || !l(u.from) ? !1 : r(u.from, n) && r(n, u.to);
|
|
116
|
+
}
|
|
117
|
+
function t(n, u) {
|
|
118
|
+
return l(u) && e(n) >= e(u);
|
|
119
|
+
}
|
|
120
|
+
function f(n, u) {
|
|
121
|
+
return l(u) && e(n) <= e(u);
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
isDateEarlier: i,
|
|
125
|
+
equal: h,
|
|
126
|
+
inPeriod: d,
|
|
127
|
+
isPoint: c,
|
|
128
|
+
equalOrEarlier: r,
|
|
129
|
+
isInitializedDate: l,
|
|
130
|
+
isInitializedMonth: s,
|
|
131
|
+
isInitializedYear: k,
|
|
132
|
+
isMonthDisabledByDisableSince: t,
|
|
133
|
+
isMonthDisabledByDisableUntil: f
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const oe = G({
|
|
137
|
+
name: "FDatePickerCalendarView",
|
|
138
|
+
props: ht,
|
|
139
|
+
emits: ["click", "clickWeek", "keyDown", "mouseEnter", "mouseLeave"],
|
|
140
|
+
setup(e, l) {
|
|
141
|
+
const s = o(e.dates), k = o(e.daysInWeek), i = o(e.enableKeyboadNavigate), r = o(e.enableMarkCurrent), h = o(e.enablePeriod), c = o(e.firstDayOfTheWeek), d = o(e.selected), t = o(e.selectedPeriod), f = o(e.selectedWeek), n = o(e.selectMode), u = o(e.showWeekNumber), y = o(e.weekTitle), b = O(() => u.value && c.value === "Mon");
|
|
142
|
+
J(() => e.dates, () => {
|
|
143
|
+
s.value = e.dates;
|
|
144
|
+
}), J(() => e.selected, () => {
|
|
145
|
+
d.value = e.selected;
|
|
146
|
+
});
|
|
147
|
+
const {
|
|
148
|
+
equal: I,
|
|
149
|
+
inPeriod: B,
|
|
150
|
+
isInitializedDate: x,
|
|
151
|
+
equalOrEarlier: N,
|
|
152
|
+
isPoint: g
|
|
153
|
+
} = te(), {
|
|
154
|
+
getKeyCodeFromEvent: p
|
|
155
|
+
} = ie(), C = (a) => {
|
|
156
|
+
const T = !!f.value && a.numberInTheYear === f.value.numberInTheYear && a.year === f.value.year;
|
|
157
|
+
return {
|
|
158
|
+
"f-datepicker-selectWeek": n.value === "week",
|
|
159
|
+
"f-datepicker-selectedWeek": n.value === "week" && T
|
|
160
|
+
};
|
|
161
|
+
}, m = O(() => u.value && c.value === "Mon");
|
|
162
|
+
function D(a) {
|
|
163
|
+
return B(a, t.value);
|
|
164
|
+
}
|
|
165
|
+
function S(a) {
|
|
166
|
+
return !!t.value && g(t.value, a);
|
|
167
|
+
}
|
|
168
|
+
function W(a) {
|
|
169
|
+
return !!d.value && I({
|
|
170
|
+
year: d.value.year,
|
|
171
|
+
month: d.value.month,
|
|
172
|
+
day: d.value.day
|
|
173
|
+
}, a);
|
|
174
|
+
}
|
|
175
|
+
const R = (a, T, M) => {
|
|
176
|
+
const A = n.value !== "week" && a.tag === q.current && (h.value && D(a.date) && !S(a.date) || a.range), V = a.tag === q.previous || a.tag === q.next, z = {
|
|
177
|
+
"f-datepicker-range": A,
|
|
178
|
+
"f-datepicker-no-currmonth": V,
|
|
179
|
+
"f-datepicker-disabled": a.disable,
|
|
180
|
+
"f-datepicker-singledate": !a.disable
|
|
181
|
+
}, Q = `d_${T}_${M}`;
|
|
182
|
+
return z[Q] = !0, z;
|
|
183
|
+
}, L = (a) => {
|
|
184
|
+
const T = n.value !== "week" && a.tag === q.current && (!h.value && W(a.date) || h.value && S(a.date)), M = a.isCurrent && r.value, A = a.highlight && (a.tag === q.previous || a.tag === q.next || a.disable);
|
|
185
|
+
return {
|
|
186
|
+
"f-datepicker-date": !0,
|
|
187
|
+
"f-datepicker-selected": T,
|
|
188
|
+
"f-datepicker-current": M,
|
|
189
|
+
"f-datepicker-opacity": A,
|
|
190
|
+
"f-datepicker-highlight": a.highlight,
|
|
191
|
+
"f-datepicker-disabled": a.disable
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
function $(a, T) {
|
|
195
|
+
T.disable || n.value === "week" || (a.stopPropagation(), l.emit("click", T.date));
|
|
196
|
+
}
|
|
197
|
+
function F(a, T) {
|
|
198
|
+
n.value === "week" && (a.stopPropagation(), l.emit("clickWeek", T));
|
|
199
|
+
}
|
|
200
|
+
function _(a, T) {
|
|
201
|
+
const M = p(a);
|
|
202
|
+
M !== H.tab && (a.preventDefault(), M === H.enter || M === H.space ? $(a, T) : i.value && l.emit("keyDown", T.date));
|
|
203
|
+
}
|
|
204
|
+
function K(a) {
|
|
205
|
+
t.value && x(t.value.from) && !x(t.value.to) && (s.value.forEach((T) => {
|
|
206
|
+
T.days.forEach((M) => {
|
|
207
|
+
M.range = !!t.value && (N(t.value.from, M.date) && N(M.date, a.date) || N(M.date, t.value.from) && N(a.date, M.date));
|
|
208
|
+
});
|
|
209
|
+
}), l.emit("mouseEnter", a.date));
|
|
210
|
+
}
|
|
211
|
+
function U() {
|
|
212
|
+
s.value.forEach((a) => {
|
|
213
|
+
a.days.forEach((T) => {
|
|
214
|
+
T.range = !1;
|
|
215
|
+
});
|
|
216
|
+
}), l.emit("mouseLeave");
|
|
217
|
+
}
|
|
218
|
+
return () => v(se, null, [v("div", {
|
|
219
|
+
class: "f-datepicker-table-wrapper"
|
|
220
|
+
}, [v("table", {
|
|
221
|
+
class: "f-datepicker-table",
|
|
222
|
+
cellpadding: "0"
|
|
223
|
+
}, [v("thead", null, [v("tr", null, [b.value && v("th", {
|
|
224
|
+
class: "f-datepicker-weeknbr-title"
|
|
225
|
+
}, [y.value]), k.value && k.value.map((a) => v("th", {
|
|
226
|
+
scope: "col",
|
|
227
|
+
style: "padding-bottom: 8px;padding-top: 4px"
|
|
228
|
+
}, [a]))])]), v("tbody", null, [s.value && s.value.map((a, T) => v("tr", {
|
|
229
|
+
class: C(a),
|
|
230
|
+
onClick: (M) => F(M, a)
|
|
231
|
+
}, [m.value && v("td", {
|
|
232
|
+
class: "f-datepicker-weeknbr"
|
|
233
|
+
}, [v("div", {
|
|
234
|
+
class: "f-datepicker-date"
|
|
235
|
+
}, [a.numberInTheYear])]), a.days && a.days.map((M, A) => v("td", {
|
|
236
|
+
id: `d_${T}_${A}`,
|
|
237
|
+
tabindex: "0",
|
|
238
|
+
class: R(M, T, A),
|
|
239
|
+
onClick: (V) => $(V, M),
|
|
240
|
+
onKeydown: (V) => _(V, M),
|
|
241
|
+
onMouseenter: () => K(M),
|
|
242
|
+
onMouseleave: () => U()
|
|
243
|
+
}, [M.marked && M.marked.marked && v("span", {
|
|
244
|
+
class: "f-datepicker-markdate",
|
|
245
|
+
style: {
|
|
246
|
+
"background-color": M.marked.color
|
|
247
|
+
}
|
|
248
|
+
}, null), v("div", {
|
|
249
|
+
class: L(M)
|
|
250
|
+
}, [M.date.day])]))]))])])])]);
|
|
251
|
+
}
|
|
252
|
+
}), bt = {
|
|
253
|
+
activeMonth: { type: Object, require: !0 },
|
|
254
|
+
ariaLabelPrevMonth: { type: String, default: "" },
|
|
255
|
+
ariaLabelNextMonth: { type: String, default: "" },
|
|
256
|
+
dateFormat: { type: String, default: "yyyy-MM-dd" },
|
|
257
|
+
disablePrePage: { type: Boolean, default: !1 },
|
|
258
|
+
disablePreRecord: { type: Boolean, default: !1 },
|
|
259
|
+
disableNextRecord: { type: Boolean, default: !1 },
|
|
260
|
+
disableNextPage: { type: Boolean, default: !1 },
|
|
261
|
+
years: { type: Array, default: [[{}]] },
|
|
262
|
+
selectingMonth: { type: Boolean, default: !1 },
|
|
263
|
+
selectingYear: { type: Boolean, default: !1 },
|
|
264
|
+
selectMode: { type: String, default: "day" }
|
|
265
|
+
};
|
|
266
|
+
const le = G({
|
|
267
|
+
name: "FDatePickerCalendarNavbar",
|
|
268
|
+
props: bt,
|
|
269
|
+
emits: ["clickMonth", "clickYear", "prePage", "preRecord", "nextRecord", "nextPage"],
|
|
270
|
+
setup(e, l) {
|
|
271
|
+
return () => {
|
|
272
|
+
const s = o(e.ariaLabelPrevMonth), k = o(e.ariaLabelNextMonth), i = o(e.dateFormat), r = o(e.disablePrePage), h = o(e.disablePreRecord), c = o(e.disableNextRecord), d = o(e.disableNextPage), t = o(e.activeMonth), f = o(e.years), n = o(e.selectingMonth), u = o(e.selectingYear), y = o(e.selectMode), b = o(!0), I = o(!0);
|
|
273
|
+
J(() => e.activeMonth, () => {
|
|
274
|
+
var a, T, M, A;
|
|
275
|
+
t.value = {
|
|
276
|
+
month: (a = e.activeMonth) == null ? void 0 : a.month,
|
|
277
|
+
year: (T = e.activeMonth) == null ? void 0 : T.year,
|
|
278
|
+
displayTextOfMonth: (M = e.activeMonth) == null ? void 0 : M.displayTextOfMonth,
|
|
279
|
+
displayTextOfYear: (A = e.activeMonth) == null ? void 0 : A.displayTextOfMonth
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
const B = O(() => ({
|
|
283
|
+
"f-datepicker-header": !0,
|
|
284
|
+
monthYearSelBarBorder: n.value || u.value
|
|
285
|
+
})), x = O(() => ({
|
|
286
|
+
"f-datepicker-header-btn": !0,
|
|
287
|
+
"f-datepicker-header-btn-disabled": r.value
|
|
288
|
+
})), N = O(() => !n.value && !u.value), g = O(() => ({
|
|
289
|
+
"f-datepicker-header-btn": !0,
|
|
290
|
+
"f-datepicker-header-btn-disabled": h.value
|
|
291
|
+
})), p = O(() => ({
|
|
292
|
+
"f-datepicker-header-btn": !0,
|
|
293
|
+
"f-datepicker-header-btn-disabled": c.value
|
|
294
|
+
})), C = O(() => ({
|
|
295
|
+
"f-datepicker-header-btn": !0,
|
|
296
|
+
"f-datepicker-header-btn-disabled": d.value
|
|
297
|
+
})), m = O(() => ({
|
|
298
|
+
"f-datepicker-header-btn": !0,
|
|
299
|
+
"f-datepicker-yearLabel": b.value,
|
|
300
|
+
"f-datepicker-labelBtnNotEdit": !b.value
|
|
301
|
+
})), D = O(() => ({
|
|
302
|
+
"f-datepicker-header-btn": !0,
|
|
303
|
+
"f-datepicker-monthLabel": I.value,
|
|
304
|
+
"f-datepicker-labelBtnNotEdit": !I.value
|
|
305
|
+
})), S = O(() => {
|
|
306
|
+
const a = i.value ? i.value.indexOf("yyyy") : 0, T = i.value ? i.value.indexOf("MM") : 0;
|
|
307
|
+
return a > T ? "MM-yyyy" : "yyyy-MM";
|
|
308
|
+
});
|
|
309
|
+
function W(a) {
|
|
310
|
+
a.stopPropagation(), l.emit("prePage");
|
|
311
|
+
}
|
|
312
|
+
function R(a) {
|
|
313
|
+
a.stopPropagation(), l.emit("preRecord");
|
|
314
|
+
}
|
|
315
|
+
function L(a) {
|
|
316
|
+
a.stopPropagation(), l.emit("clickYear");
|
|
317
|
+
}
|
|
318
|
+
function $(a) {
|
|
319
|
+
a.stopPropagation(), l.emit("clickMonth");
|
|
320
|
+
}
|
|
321
|
+
function F(a) {
|
|
322
|
+
a.stopPropagation(), a.stopPropagation(), l.emit("nextRecord");
|
|
323
|
+
}
|
|
324
|
+
function _(a) {
|
|
325
|
+
a.stopPropagation(), l.emit("nextPage");
|
|
326
|
+
}
|
|
327
|
+
function K() {
|
|
328
|
+
return v("button", {
|
|
329
|
+
type: "button",
|
|
330
|
+
class: m.value,
|
|
331
|
+
onClick: (a) => {
|
|
332
|
+
b.value && L(a);
|
|
333
|
+
},
|
|
334
|
+
tabindex: b.value ? "0" : "-1",
|
|
335
|
+
disabled: y.value === "year"
|
|
336
|
+
}, [u.value ? f.value.length > 3 ? f.value[0][1].year + " - " + f.value[3][1].year : "" : t.value.displayTextOfYear]);
|
|
337
|
+
}
|
|
338
|
+
function U() {
|
|
339
|
+
return !u.value && y.value !== "month" && v("button", {
|
|
340
|
+
type: "button",
|
|
341
|
+
class: D.value,
|
|
342
|
+
onClick: (a) => {
|
|
343
|
+
I.value && $(a);
|
|
344
|
+
},
|
|
345
|
+
tabindex: I.value ? "0" : "-1"
|
|
346
|
+
}, [t.value.displayTextOfMonth]);
|
|
347
|
+
}
|
|
348
|
+
return v("div", {
|
|
349
|
+
class: B.value
|
|
350
|
+
}, [v("div", {
|
|
351
|
+
class: "f-datepicker-prev-btn"
|
|
352
|
+
}, [v("button", {
|
|
353
|
+
title: "prePage",
|
|
354
|
+
type: "button",
|
|
355
|
+
class: x.value,
|
|
356
|
+
onClick: W
|
|
357
|
+
}, [v("i", {
|
|
358
|
+
class: "k-icon k-i-arrow-double-60-left"
|
|
359
|
+
}, null)]), N.value && v("button", {
|
|
360
|
+
type: "button",
|
|
361
|
+
"aria-label": s.value,
|
|
362
|
+
class: g.value,
|
|
363
|
+
onClick: R
|
|
364
|
+
}, [v("i", {
|
|
365
|
+
class: "k-icon k-i-arrow-chevron-left"
|
|
366
|
+
}, null)])]), v("div", {
|
|
367
|
+
class: "f-datepicker-monthYearText"
|
|
368
|
+
}, [S.value === "yyyy-MM" ? [K(), U()] : [U(), K()]]), v("div", {
|
|
369
|
+
class: "f-datepicker-next-btn"
|
|
370
|
+
}, [N.value && v("button", {
|
|
371
|
+
type: "button",
|
|
372
|
+
"aria-label": k.value,
|
|
373
|
+
class: p.value,
|
|
374
|
+
onClick: F
|
|
375
|
+
}, [v("i", {
|
|
376
|
+
class: "k-icon k-i-arrow-chevron-right"
|
|
377
|
+
}, null)]), v("button", {
|
|
378
|
+
title: "nextPage",
|
|
379
|
+
type: "button",
|
|
380
|
+
class: C.value,
|
|
381
|
+
onClick: _
|
|
382
|
+
}, [v("i", {
|
|
383
|
+
class: "k-icon k-i-arrow-double-60-right"
|
|
384
|
+
}, null)])])]);
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
}), Te = {
|
|
388
|
+
1: "Jan",
|
|
389
|
+
2: "Feb",
|
|
390
|
+
3: "Mar",
|
|
391
|
+
4: "Apr",
|
|
392
|
+
5: "May",
|
|
393
|
+
6: "Jun",
|
|
394
|
+
7: "Jul",
|
|
395
|
+
8: "Aug",
|
|
396
|
+
9: "Sep",
|
|
397
|
+
10: "Oct",
|
|
398
|
+
11: "Nov",
|
|
399
|
+
12: "Dec"
|
|
400
|
+
}, mt = {
|
|
401
|
+
top: { type: Number, default: 0 },
|
|
402
|
+
left: { type: Number, default: 0 },
|
|
403
|
+
position: { type: String, default: "bottom" },
|
|
404
|
+
enablePeriod: { type: Boolean, default: !1 },
|
|
405
|
+
dateFormat: { type: String, default: "MM-dd-yyyy" },
|
|
406
|
+
dates: { type: Array, default: [] },
|
|
407
|
+
daysInWeek: { type: Array, default: ae },
|
|
408
|
+
disableDates: { Type: Array, default: [] },
|
|
409
|
+
disablePeriod: { Type: Array, default: [] },
|
|
410
|
+
disableSince: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
411
|
+
disableWeekdays: { Type: Array, default: [] },
|
|
412
|
+
disableWeekends: { Type: Boolean, default: !1 },
|
|
413
|
+
disableUntil: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
414
|
+
enableKeyboadNavigate: { type: Boolean, default: !0 },
|
|
415
|
+
enableMarkCurrent: { type: Boolean, default: !0 },
|
|
416
|
+
firstDayOfTheWeek: { type: String, default: "Sun." },
|
|
417
|
+
highlightDates: { Type: Array, default: [] },
|
|
418
|
+
highlightSaturday: { Type: Boolean, default: !1 },
|
|
419
|
+
highlightSunday: { Type: Boolean, default: !1 },
|
|
420
|
+
maxYear: { Type: Number, default: 2500 },
|
|
421
|
+
minYear: { Type: Number, default: 1 },
|
|
422
|
+
months: { type: Array, default: [[]] },
|
|
423
|
+
nameOfMonths: { Type: Object, default: Te },
|
|
424
|
+
secondaryDates: { type: Array, default: [] },
|
|
425
|
+
secondaryMonths: { type: Array, default: [[]] },
|
|
426
|
+
selectedDate: { type: Object, default: null },
|
|
427
|
+
selectedMonth: { type: Object, default: null },
|
|
428
|
+
selectedPeriod: { type: Object, default: null },
|
|
429
|
+
selectedWeek: { type: Object, default: null },
|
|
430
|
+
selectMode: { type: String, default: "day" },
|
|
431
|
+
showWeekNumber: { type: Boolean, default: !1 },
|
|
432
|
+
weekTitle: { type: String, default: "Week" },
|
|
433
|
+
years: { Type: Array, default: [[]] }
|
|
434
|
+
}, kt = {
|
|
435
|
+
months: { Type: Array, default: [[]] },
|
|
436
|
+
enableMarkCurrent: { Type: Boolean, default: !1 },
|
|
437
|
+
enableKeyboadNavigate: { Type: Boolean, default: !0 },
|
|
438
|
+
enablePeriod: { Type: Boolean, default: !1 },
|
|
439
|
+
selected: { Type: Object, default: null },
|
|
440
|
+
selectedPeriod: { Type: Object, default: null }
|
|
441
|
+
}, re = G({
|
|
442
|
+
name: "FDatePickerMonthView",
|
|
443
|
+
props: kt,
|
|
444
|
+
emits: ["click", "keyDown", "mouseEnter", "mouseLeave"],
|
|
445
|
+
setup(e, l) {
|
|
446
|
+
const s = o(e.months), k = o(e.enableMarkCurrent), i = o(e.enableKeyboadNavigate), r = o(e.enablePeriod), h = o(e.selected), c = o(e.selectedPeriod), {
|
|
447
|
+
equal: d,
|
|
448
|
+
inPeriod: t,
|
|
449
|
+
isInitializedDate: f,
|
|
450
|
+
equalOrEarlier: n
|
|
451
|
+
} = te(), {
|
|
452
|
+
getKeyCodeFromEvent: u
|
|
453
|
+
} = ie();
|
|
454
|
+
J(() => e.months, () => {
|
|
455
|
+
s.value = e.months;
|
|
456
|
+
}), J(() => e.selected, () => {
|
|
457
|
+
h.value = e.selected;
|
|
458
|
+
});
|
|
459
|
+
function y(C, m) {
|
|
460
|
+
C.stopPropagation(), !m.disable && l.emit("click", m);
|
|
461
|
+
}
|
|
462
|
+
function b(C, m) {
|
|
463
|
+
const D = u(C);
|
|
464
|
+
D !== H.tab && (C.preventDefault(), D === H.enter || D === H.space ? y(C, m) : i.value && l.emit("keyDown", m));
|
|
465
|
+
}
|
|
466
|
+
function I(C) {
|
|
467
|
+
c.value && f(c.value.from) && !f(c.value.to) && (s.value.forEach((m) => {
|
|
468
|
+
m.forEach((D) => {
|
|
469
|
+
D.range = !!c.value && (n(c.value.from, D.date) && n(D.date, C.date) || n(D.date, c.value.from) && n(C.date, D.date));
|
|
470
|
+
});
|
|
471
|
+
}), l.emit("mouseEnter", C));
|
|
472
|
+
}
|
|
473
|
+
function B() {
|
|
474
|
+
s.value.forEach((C) => {
|
|
475
|
+
C.forEach((m) => {
|
|
476
|
+
m.range = !1;
|
|
477
|
+
});
|
|
478
|
+
}), l.emit("mouseLeave");
|
|
479
|
+
}
|
|
480
|
+
function x(C) {
|
|
481
|
+
return !!h.value && d({
|
|
482
|
+
year: h.value.year,
|
|
483
|
+
month: h.value.month
|
|
484
|
+
}, {
|
|
485
|
+
year: C.year,
|
|
486
|
+
month: C.month
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
function N(C) {
|
|
490
|
+
return !!c.value && (d({
|
|
491
|
+
year: c.value.from.month
|
|
492
|
+
}, C) || d({
|
|
493
|
+
year: c.value.to.month
|
|
494
|
+
}, C));
|
|
495
|
+
}
|
|
496
|
+
function g(C) {
|
|
497
|
+
return t(C, c.value);
|
|
498
|
+
}
|
|
499
|
+
const p = (C) => ({
|
|
500
|
+
"f-datepicker-month-cell": !0,
|
|
501
|
+
"f-datepicker-current": C.isCurrent && k,
|
|
502
|
+
"f-datepicker-selected": !r.value && x(C.date) || r.value && N(C.date),
|
|
503
|
+
"f-datepicker-disabled": C.disable,
|
|
504
|
+
"f-datepicker-range": g(C.date) || C.range
|
|
505
|
+
});
|
|
506
|
+
return () => v("div", {
|
|
507
|
+
class: "f-datepicker-table-wrapper"
|
|
508
|
+
}, [v("table", {
|
|
509
|
+
class: "f-datepicker-table"
|
|
510
|
+
}, [v("tbody", null, [s.value && s.value.map((C, m) => v("tr", null, [C.map((D, S) => v("td", {
|
|
511
|
+
id: `m_${m}_${S}`,
|
|
512
|
+
class: `m_${m}_${S}`,
|
|
513
|
+
onClick: (W) => y(W, D),
|
|
514
|
+
onKeydown: (W) => b(W, D),
|
|
515
|
+
onMouseenter: () => I(D),
|
|
516
|
+
onMouseleave: () => B(),
|
|
517
|
+
tabindex: "0",
|
|
518
|
+
style: "width: 33.3%"
|
|
519
|
+
}, [v("div", {
|
|
520
|
+
class: "f-datepicker-month"
|
|
521
|
+
}, [v("span", {
|
|
522
|
+
class: p(D)
|
|
523
|
+
}, [D.displayText])])]))]))])])]);
|
|
524
|
+
}
|
|
525
|
+
}), gt = {
|
|
526
|
+
years: { Type: Array, default: [[]] },
|
|
527
|
+
enableKeyboadNavigate: { Type: Boolean, default: !0 },
|
|
528
|
+
enableMarkCurrent: { Type: Boolean, default: !0 },
|
|
529
|
+
enablePeriod: { Type: Boolean, default: !1 },
|
|
530
|
+
selected: { Type: Object, default: null },
|
|
531
|
+
selectedPeriod: { Type: Object, default: null }
|
|
532
|
+
}, ue = G({
|
|
533
|
+
name: "FDatePickerYearView",
|
|
534
|
+
props: gt,
|
|
535
|
+
emits: ["click", "keyDown", "mouseEnter", "mouseLeave"],
|
|
536
|
+
setup(e, l) {
|
|
537
|
+
const s = o(e.years), k = o(e.enableMarkCurrent), i = o(e.enableKeyboadNavigate), r = o(e.enablePeriod), h = o(e.selected), c = o(e.selectedPeriod), {
|
|
538
|
+
equal: d,
|
|
539
|
+
inPeriod: t,
|
|
540
|
+
isInitializedDate: f,
|
|
541
|
+
equalOrEarlier: n
|
|
542
|
+
} = te(), {
|
|
543
|
+
getKeyCodeFromEvent: u
|
|
544
|
+
} = ie();
|
|
545
|
+
J(() => e.years, () => {
|
|
546
|
+
s.value = e.years;
|
|
547
|
+
}), J(() => e.selected, () => {
|
|
548
|
+
h.value = e.selected;
|
|
549
|
+
});
|
|
550
|
+
const y = (m, D) => {
|
|
551
|
+
const S = `y_${m}_${D}`, W = {
|
|
552
|
+
"f-datepicker-no-currmonth": m === 0 && D === 0 || m === 3 && D === 2
|
|
553
|
+
};
|
|
554
|
+
return W[S] = !0, W;
|
|
555
|
+
};
|
|
556
|
+
function b(m) {
|
|
557
|
+
return t(m, c.value);
|
|
558
|
+
}
|
|
559
|
+
function I(m) {
|
|
560
|
+
return !!h.value && d({
|
|
561
|
+
year: h.value.year
|
|
562
|
+
}, m);
|
|
563
|
+
}
|
|
564
|
+
function B(m) {
|
|
565
|
+
return !!c.value && (d({
|
|
566
|
+
year: c.value.from.year
|
|
567
|
+
}, m) || d({
|
|
568
|
+
year: c.value.to.year
|
|
569
|
+
}, m));
|
|
570
|
+
}
|
|
571
|
+
const x = (m) => ({
|
|
572
|
+
"f-datepicker-year-cell": !0,
|
|
573
|
+
"f-datepicker-current": m.isCurrent && k.value,
|
|
574
|
+
"f-datepicker-selected": !c.value && I(m.date) || r.value && B(m.date),
|
|
575
|
+
"f-datepicker-disabled": m.disable,
|
|
576
|
+
"f-datepicker-range": b(m.date) || m.range
|
|
577
|
+
});
|
|
578
|
+
function N(m, D) {
|
|
579
|
+
m.stopPropagation(), !D.disable && l.emit("click", D);
|
|
580
|
+
}
|
|
581
|
+
function g(m, D) {
|
|
582
|
+
const S = u(m);
|
|
583
|
+
S !== H.tab && (m.preventDefault(), S === H.enter || S === H.space ? N(m, D) : i.value && l.emit("keyDown", D));
|
|
584
|
+
}
|
|
585
|
+
function p(m) {
|
|
586
|
+
c.value && f(c.value.from) && !f(c.value.to) && (s.value.forEach((D) => {
|
|
587
|
+
D.forEach((S) => {
|
|
588
|
+
S.range = !!c.value && (n(c.value.from, S.date) && n(S.date, m.date) || n(S.date, c.value.from) && n(m.date, S.date));
|
|
589
|
+
});
|
|
590
|
+
}), l.emit("mouseEnter", m));
|
|
591
|
+
}
|
|
592
|
+
function C() {
|
|
593
|
+
s.value.forEach((m) => {
|
|
594
|
+
m.forEach((D) => {
|
|
595
|
+
D.range = !1;
|
|
596
|
+
});
|
|
597
|
+
}), l.emit("mouseLeave");
|
|
598
|
+
}
|
|
599
|
+
return () => v("table", {
|
|
600
|
+
class: "f-datepicker-table-wrapper"
|
|
601
|
+
}, [v("tbody", {
|
|
602
|
+
class: "f-datepicker-table"
|
|
603
|
+
}, [s.value && s.value.map((m, D) => v("tr", null, [m.map((S, W) => v("td", {
|
|
604
|
+
id: "y_{yi}_{i}",
|
|
605
|
+
class: y(D, W),
|
|
606
|
+
onClick: (R) => N(R, S),
|
|
607
|
+
onKeydown: (R) => g(R, S),
|
|
608
|
+
onMouseenter: () => p(S),
|
|
609
|
+
onMouseleave: () => C(),
|
|
610
|
+
tabindex: "0"
|
|
611
|
+
}, [v("div", {
|
|
612
|
+
class: "f-datepicker-year"
|
|
613
|
+
}, [v("span", {
|
|
614
|
+
class: x(S)
|
|
615
|
+
}, [S.year])])]))]))])]);
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
function ce() {
|
|
619
|
+
function e(i) {
|
|
620
|
+
return new Date(
|
|
621
|
+
i.year || 0,
|
|
622
|
+
(i.month || 1) - 1,
|
|
623
|
+
i.day,
|
|
624
|
+
i.hour ? i.hour : 0,
|
|
625
|
+
i.minute ? i.minute : 0,
|
|
626
|
+
i.second ? i.second : 0,
|
|
627
|
+
0
|
|
628
|
+
).getDay();
|
|
629
|
+
}
|
|
630
|
+
function l(i) {
|
|
631
|
+
if (!i)
|
|
632
|
+
return 1;
|
|
633
|
+
if (!/^\d+$/.test(i.value))
|
|
634
|
+
return -1;
|
|
635
|
+
let r = Number(i.value);
|
|
636
|
+
return (i.format.length === 1 && i.value.length !== 1 && r < 10 || i.format.length === 1 && i.value.length !== 2 && r >= 10 || i.format.length === 2 && i.value.length > 2) && (r = -1), r;
|
|
637
|
+
}
|
|
638
|
+
function s(i, r) {
|
|
639
|
+
if (i.value) {
|
|
640
|
+
for (let h = 1; h <= 12; h++)
|
|
641
|
+
if (i.value.toLowerCase() === r[h].toLowerCase())
|
|
642
|
+
return h;
|
|
643
|
+
}
|
|
644
|
+
return -1;
|
|
645
|
+
}
|
|
646
|
+
function k(i) {
|
|
647
|
+
const r = new Date(i.year || 0, (i.month || 1) - 1, i.day, 0, 0, 0, 0);
|
|
648
|
+
return r.setDate(r.getDate() + (r.getDay() === 0 ? -3 : 4 - r.getDay())), Math.round((r.getTime() - new Date(r.getFullYear(), 0, 4).getTime()) / 864e5 / 7) + 1;
|
|
649
|
+
}
|
|
650
|
+
return { getNumberByValue: l, getDayNumber: e, getMonthNumberByMonthName: s, getWeekNumber: k };
|
|
651
|
+
}
|
|
652
|
+
function pt(e, l, s, k, i, r, h, c) {
|
|
653
|
+
const { getTimeInMilliseconds: d, getWeekdayIndex: t } = Z(), { isInitializedDate: f } = te(), { getDayNumber: n } = ce();
|
|
654
|
+
function u(y) {
|
|
655
|
+
if (y.year && y.year < e && y.month === 12 || y.year && y.year > l && y.month === 1)
|
|
656
|
+
return !0;
|
|
657
|
+
const b = d(y);
|
|
658
|
+
if (f(k) && b + 24 * 60 * 60 * 1e3 - 1 < d(k) || f(s) && b > d(s))
|
|
659
|
+
return !0;
|
|
660
|
+
if (h) {
|
|
661
|
+
const B = n(y);
|
|
662
|
+
if (B === 0 || B === 6)
|
|
663
|
+
return !0;
|
|
664
|
+
}
|
|
665
|
+
const I = n(y);
|
|
666
|
+
return !!(c.length > 0 && c.find((x) => t(x) === I) || i.length > 0 && i.find((x) => (x.year === 0 || x.year === y.year) && (x.month === 0 || x.month === y.month) && x.day === y.day) || r.length > 0 && r.find((x) => f(x.from) && f(x.to) && b >= d(x.from) && b <= d(x.to)));
|
|
667
|
+
}
|
|
668
|
+
return { isDisabledDate: u };
|
|
669
|
+
}
|
|
670
|
+
function Mt() {
|
|
671
|
+
const { getDayNumber: e } = ce();
|
|
672
|
+
function l(k, i, r) {
|
|
673
|
+
let h = [];
|
|
674
|
+
h = i.reduce((d, t) => {
|
|
675
|
+
const f = t.dates.map((n) => ({ date: n, color: t.color }));
|
|
676
|
+
return [...d, ...f];
|
|
677
|
+
}, h);
|
|
678
|
+
const c = h.find((d) => (d.date.year === 0 || d.date.year === k.year) && (d.date.month === 0 || d.date.month === k.month) && d.date.day === k.day);
|
|
679
|
+
if (c)
|
|
680
|
+
return { marked: !0, color: c.color };
|
|
681
|
+
if (r && r.marked) {
|
|
682
|
+
const d = e(k);
|
|
683
|
+
if (d === 0 || d === 6)
|
|
684
|
+
return { marked: !0, color: r.color };
|
|
685
|
+
}
|
|
686
|
+
return { marked: !1, color: "" };
|
|
687
|
+
}
|
|
688
|
+
function s(k, i, r, h) {
|
|
689
|
+
const c = e(k);
|
|
690
|
+
return i && c === 0 || r && c === 6 ? !0 : !!h.find((t) => (t.year === 0 || t.year === k.year) && (t.month === 0 || t.month === k.month) && t.day === k.day);
|
|
691
|
+
}
|
|
692
|
+
return { isHighlightedDate: s, isMarkedDate: l };
|
|
693
|
+
}
|
|
694
|
+
function xe() {
|
|
695
|
+
const { getTimeInMilliseconds: e } = Z(), { isInitializedDate: l } = te();
|
|
696
|
+
function s(i, r) {
|
|
697
|
+
return l(r) && e(i) <= e(r);
|
|
698
|
+
}
|
|
699
|
+
function k(i, r) {
|
|
700
|
+
return l(r) && e(i) >= e(r);
|
|
701
|
+
}
|
|
702
|
+
return { isMonthDisabledByDisableSince: k, isMonthDisabledByDisableUntil: s };
|
|
703
|
+
}
|
|
704
|
+
function de() {
|
|
705
|
+
const { getToday: e } = Z(), { isMonthDisabledByDisableSince: l, isMonthDisabledByDisableUntil: s } = xe();
|
|
706
|
+
function k(f) {
|
|
707
|
+
const n = { displayTextOfMonth: "", month: 0, year: 0, displayTextOfYear: "" };
|
|
708
|
+
if (f) {
|
|
709
|
+
const u = f.match(/[^0-9]/), y = u && u.length ? u[0] : "", b = f.split(y);
|
|
710
|
+
n.month = b[0].length === 2 ? Number(b[0]) : Number(b[1]), n.year = b[0].length === 2 ? Number(b[1]) : Number(b[0]);
|
|
711
|
+
}
|
|
712
|
+
return n;
|
|
713
|
+
}
|
|
714
|
+
function i(f, n) {
|
|
715
|
+
return new Date(n, f, 0).getDate();
|
|
716
|
+
}
|
|
717
|
+
function r(f, n, u) {
|
|
718
|
+
return new Date(f, n - 1, u, 0, 0, 0, 0);
|
|
719
|
+
}
|
|
720
|
+
function h(f, n) {
|
|
721
|
+
const u = r(n, f, 1);
|
|
722
|
+
return u.setMonth(u.getMonth() - 1), i(u.getMonth() + 1, u.getFullYear());
|
|
723
|
+
}
|
|
724
|
+
function c(f, n, u, y) {
|
|
725
|
+
const b = e(), I = [], { year: B } = n, x = 3;
|
|
726
|
+
for (let N = 1; N <= 12; N += x) {
|
|
727
|
+
const g = [];
|
|
728
|
+
for (let p = N; p < N + x; p++) {
|
|
729
|
+
const C = l({ year: B, month: p, day: 1 }, u) || s({ year: B, month: p, day: i(p, B || 0) }, y);
|
|
730
|
+
g.push({
|
|
731
|
+
month: p,
|
|
732
|
+
displayText: f[p],
|
|
733
|
+
isCurrent: p === b.month && B === b.year,
|
|
734
|
+
disable: C,
|
|
735
|
+
date: { year: B, month: p }
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
I.push(g);
|
|
739
|
+
}
|
|
740
|
+
return I;
|
|
741
|
+
}
|
|
742
|
+
function d(f, n) {
|
|
743
|
+
const u = {
|
|
744
|
+
year: f === 12 ? n + 1 : n
|
|
745
|
+
}, y = f === 12 ? 1 : f + 1;
|
|
746
|
+
return u.month = y, u;
|
|
747
|
+
}
|
|
748
|
+
function t(f, n) {
|
|
749
|
+
const u = {
|
|
750
|
+
year: f === 1 ? n - 1 : n
|
|
751
|
+
}, y = f === 1 ? 12 : f - 1;
|
|
752
|
+
return u.month = y, u;
|
|
753
|
+
}
|
|
754
|
+
return { daysInMonth: i, daysInPreMonth: h, generateMonths: c, parseDefaultMonth: k, getNextMonth: d, getPreviousMonth: t };
|
|
755
|
+
}
|
|
756
|
+
function Pt({ isDisabledDate: e }) {
|
|
757
|
+
const { getToday: l } = Z(), { daysInMonth: s, daysInPreMonth: k, getNextMonth: i, getPreviousMonth: r } = de(), { isHighlightedDate: h, isMarkedDate: c } = Mt(), { getWeekNumber: d } = ce();
|
|
758
|
+
function t(y) {
|
|
759
|
+
const b = ae.indexOf(y);
|
|
760
|
+
return b > 0 ? 7 - b : 0;
|
|
761
|
+
}
|
|
762
|
+
function f(y, b, I) {
|
|
763
|
+
const B = new Date();
|
|
764
|
+
B.setDate(1), B.setMonth(b - 1), B.setFullYear(y);
|
|
765
|
+
const x = B.getDay() + I;
|
|
766
|
+
return x >= 7 ? x - 7 : x;
|
|
767
|
+
}
|
|
768
|
+
function n(y, b, I, B, x) {
|
|
769
|
+
return y === x.day && b === x.month && I === x.year && B === q.current;
|
|
770
|
+
}
|
|
771
|
+
function u(y, b, I, B, x, N, g, p, C) {
|
|
772
|
+
const m = [], D = l(), S = f(b, y, t(I)), W = s(y, b), R = k(y, b);
|
|
773
|
+
let L = 1, $ = q.previous;
|
|
774
|
+
for (let F = 1; F < 7; F++) {
|
|
775
|
+
const _ = [];
|
|
776
|
+
if (F === 1) {
|
|
777
|
+
const U = R - S + 1;
|
|
778
|
+
for (let T = U; T <= R; T++) {
|
|
779
|
+
const M = {
|
|
780
|
+
year: y === 1 ? b - 1 : b,
|
|
781
|
+
month: y === 1 ? 12 : y - 1,
|
|
782
|
+
day: T
|
|
783
|
+
}, A = n(T, y, b, $, D), V = e(M), z = c(M, B, x), Q = h(M, p, g, N);
|
|
784
|
+
_.push({ date: M, tag: $, isCurrent: A, disable: V, marked: z, highlight: Q });
|
|
785
|
+
}
|
|
786
|
+
$ = q.current;
|
|
787
|
+
const a = 7 - _.length;
|
|
788
|
+
for (let T = 0; T < a; T++) {
|
|
789
|
+
const M = { year: b, month: y, day: L }, A = n(L, y, b, $, D), V = e(M), z = c(M, B, x), Q = h(M, p, g, N);
|
|
790
|
+
_.push({ date: M, tag: $, isCurrent: A, disable: V, marked: z, highlight: Q }), L++;
|
|
791
|
+
}
|
|
792
|
+
} else
|
|
793
|
+
for (let U = 1; U <= 7; U++) {
|
|
794
|
+
L > W && (L = 1, $ = q.next);
|
|
795
|
+
const a = {
|
|
796
|
+
year: $ === q.next && y === 12 ? b + 1 : b,
|
|
797
|
+
month: $ === q.current ? y : $ === q.next && y < 12 ? y + 1 : 1,
|
|
798
|
+
day: L
|
|
799
|
+
}, T = n(L, y, b, $, D), M = e(a), A = c(a, B, x), V = h(a, p, g, N);
|
|
800
|
+
_.push({ date: a, tag: $, isCurrent: T, disable: M, marked: A, highlight: V }), L++;
|
|
801
|
+
}
|
|
802
|
+
const K = C && I === "Mon." ? d(_[0].date) : 0;
|
|
803
|
+
m.push({ days: _, numberInTheYear: K, year: b });
|
|
804
|
+
}
|
|
805
|
+
return m;
|
|
806
|
+
}
|
|
807
|
+
return { generateCalendar: u };
|
|
808
|
+
}
|
|
809
|
+
function Tt() {
|
|
810
|
+
const { getToday: e } = Z(), { daysInMonth: l } = de(), { isMonthDisabledByDisableSince: s, isMonthDisabledByDisableUntil: k } = xe();
|
|
811
|
+
function i(r, h, c, d, t, f) {
|
|
812
|
+
const n = [], u = r - r % 10, { year: y, month: b } = h, I = e(), B = 3, x = u + 10;
|
|
813
|
+
for (let N = u - 1; N < x; N += B) {
|
|
814
|
+
const g = [];
|
|
815
|
+
for (let p = N; p < N + B; p++) {
|
|
816
|
+
const C = s({ year: p, month: b, day: 1 }, t) || k({ year: p, month: b, day: l(b || 0, p) }, f), m = p < c || p > d;
|
|
817
|
+
g.push({
|
|
818
|
+
year: p,
|
|
819
|
+
isCurrent: p === I.year,
|
|
820
|
+
selected: p === y,
|
|
821
|
+
disable: C || m,
|
|
822
|
+
date: { year: p }
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
n.push(g);
|
|
826
|
+
}
|
|
827
|
+
return n;
|
|
828
|
+
}
|
|
829
|
+
return { generateYears: i };
|
|
830
|
+
}
|
|
831
|
+
const Me = G({
|
|
832
|
+
name: "FDatePickerContainer",
|
|
833
|
+
props: mt,
|
|
834
|
+
emits: ["datePicked"],
|
|
835
|
+
setup(e, l) {
|
|
836
|
+
const s = o(e.top), k = o(e.left), i = o(e.position), r = o(e.enablePeriod), h = o(e.selectMode), c = o(e.dateFormat), d = o(e.nameOfMonths), t = o([]), f = o(!1), n = o(""), u = o(!1), y = o(""), b = o(), I = o(!1), B = o(!1), x = o(!1), N = o(!1), g = o(!1), p = o(!1), C = o(!1), m = o(!1), D = o(e.secondaryDates), S = o(e.daysInWeek), W = o(e.enableKeyboadNavigate), R = o(e.enableMarkCurrent), L = o(e.firstDayOfTheWeek), $ = o(e.showWeekNumber), F = o(e.selectedDate), _ = o(e.selectedWeek), K = o(e.selectedPeriod), U = o(e.weekTitle), a = o(e.secondaryMonths), T = o(e.selectedMonth), M = o(e.minYear), A = o(e.maxYear), V = o(e.disableSince), z = o(e.disableUntil), Q = o(e.disableDates), De = o(e.disablePeriod), Be = o(e.disableWeekdays), we = o(e.disableWeekends), Oe = pt(M.value, A.value, V.value, z.value, Q.value, De.value, we.value, Be.value), {
|
|
837
|
+
generateCalendar: Ne
|
|
838
|
+
} = Pt(Oe), {
|
|
839
|
+
getToday: Se
|
|
840
|
+
} = Z(), {
|
|
841
|
+
generateMonths: Ye,
|
|
842
|
+
getNextMonth: Ie,
|
|
843
|
+
getPreviousMonth: Ee
|
|
844
|
+
} = de(), {
|
|
845
|
+
generateYears: We
|
|
846
|
+
} = Tt(), E = Se(), Y = o({
|
|
847
|
+
year: E.year || 1,
|
|
848
|
+
month: E.month || 1,
|
|
849
|
+
displayTextOfMonth: d.value[E.month || "1"],
|
|
850
|
+
displayTextOfYear: `${E.year}`
|
|
851
|
+
}), fe = E.month === 12 ? (E.year || 1) + 1 : E.year, $e = (E.month || 1) < 12 ? (E.month || 1) + 1 : 1, je = o({
|
|
852
|
+
year: fe,
|
|
853
|
+
month: $e,
|
|
854
|
+
displayTextOfMonth: d.value[E.month || "1"],
|
|
855
|
+
displayTextOfYear: `${fe}`
|
|
856
|
+
}), Ae = O(() => Ne(Y.value.month, Y.value.year, L.value, [], {
|
|
857
|
+
marked: !0,
|
|
858
|
+
color: ""
|
|
859
|
+
}, [], e.highlightSaturday, e.highlightSunday, $.value)), Re = O(() => Ye(d.value, {
|
|
860
|
+
year: Y.value.year,
|
|
861
|
+
month: Y.value.month
|
|
862
|
+
}, V.value, z.value)), ye = O(() => We(Y.value.year, {
|
|
863
|
+
year: Y.value.year,
|
|
864
|
+
month: Y.value.month
|
|
865
|
+
}, M.value, A.value, V.value, z.value)), Le = O(() => {
|
|
866
|
+
const P = {
|
|
867
|
+
"f-datepicker-container": !0
|
|
868
|
+
}, j = `container-position-${i.value}`;
|
|
869
|
+
return P[j] = !0, P;
|
|
870
|
+
});
|
|
871
|
+
function Fe() {
|
|
872
|
+
return "";
|
|
873
|
+
}
|
|
874
|
+
const Ve = O(() => ({
|
|
875
|
+
top: `${s.value}px`,
|
|
876
|
+
left: `${k.value}px`,
|
|
877
|
+
width: Fe()
|
|
878
|
+
}));
|
|
879
|
+
function St(P) {
|
|
880
|
+
}
|
|
881
|
+
function Ke(P) {
|
|
882
|
+
P.stopPropagation();
|
|
883
|
+
}
|
|
884
|
+
function _e(P, j) {
|
|
885
|
+
const w = Y.value.year - (u.value ? 10 : 1), X = {
|
|
886
|
+
year: w,
|
|
887
|
+
month: Y.value.month,
|
|
888
|
+
displayTextOfMonth: d.value[Y.value.month || "1"],
|
|
889
|
+
displayTextOfYear: `${w}`
|
|
890
|
+
};
|
|
891
|
+
Y.value = X;
|
|
892
|
+
}
|
|
893
|
+
function ve(P, j) {
|
|
894
|
+
const w = Ee(Y.value.month, Y.value.year), X = {
|
|
895
|
+
year: w.year || 1,
|
|
896
|
+
month: w.month || 1,
|
|
897
|
+
displayTextOfMonth: d.value[w.month || "1"],
|
|
898
|
+
displayTextOfYear: `${w.year}`
|
|
899
|
+
};
|
|
900
|
+
Y.value = X;
|
|
901
|
+
}
|
|
902
|
+
function he(P, j) {
|
|
903
|
+
const w = Ie(Y.value.month, Y.value.year), X = {
|
|
904
|
+
year: w.year || 1,
|
|
905
|
+
month: w.month || 1,
|
|
906
|
+
displayTextOfMonth: d.value[w.month || "1"],
|
|
907
|
+
displayTextOfYear: `${w.year}`
|
|
908
|
+
};
|
|
909
|
+
Y.value = X;
|
|
910
|
+
}
|
|
911
|
+
function Ue(P, j) {
|
|
912
|
+
const w = Y.value.year + 1, X = {
|
|
913
|
+
year: w,
|
|
914
|
+
month: Y.value.month,
|
|
915
|
+
displayTextOfMonth: d.value[Y.value.month || "1"],
|
|
916
|
+
displayTextOfYear: `${w}`
|
|
917
|
+
};
|
|
918
|
+
Y.value = X;
|
|
919
|
+
}
|
|
920
|
+
function qe(P) {
|
|
921
|
+
f.value = !0, u.value = !1;
|
|
922
|
+
}
|
|
923
|
+
function ze(P) {
|
|
924
|
+
f.value = !1, u.value = !0;
|
|
925
|
+
}
|
|
926
|
+
const He = O(() => ({
|
|
927
|
+
"active-month": Y.value,
|
|
928
|
+
"date-format": c.value,
|
|
929
|
+
"disable-pre-page": I.value,
|
|
930
|
+
"disable-pre-record": B.value,
|
|
931
|
+
"disable-next-record": x.value,
|
|
932
|
+
"disable-next-page": N.value,
|
|
933
|
+
years: ye.value,
|
|
934
|
+
"selecting-month": f.value,
|
|
935
|
+
"selecting-year": u.value,
|
|
936
|
+
"select-mode": h.value
|
|
937
|
+
})), Je = O(() => ({
|
|
938
|
+
"active-month": je.value,
|
|
939
|
+
"date-format": c.value,
|
|
940
|
+
"disable-pre-page": g.value,
|
|
941
|
+
"disable-pre-record": p.value,
|
|
942
|
+
"disable-next-record": C.value,
|
|
943
|
+
"disable-next-page": m.value,
|
|
944
|
+
years: t.value,
|
|
945
|
+
"selecting-month": n.value,
|
|
946
|
+
"selecting-year": y.value,
|
|
947
|
+
"select-mode": h.value
|
|
948
|
+
}));
|
|
949
|
+
function be(P, j) {
|
|
950
|
+
return v(le, ee(j, {
|
|
951
|
+
onPrePage: (w) => _e(),
|
|
952
|
+
onPreRecord: (w) => ve(),
|
|
953
|
+
onNextRecord: (w) => he(),
|
|
954
|
+
onNextPage: (w) => Ue(),
|
|
955
|
+
onClickMonth: (w) => qe(),
|
|
956
|
+
onClickYear: (w) => ze()
|
|
957
|
+
}), null);
|
|
958
|
+
}
|
|
959
|
+
const me = O(() => !f.value && !u.value && !b.value || r.value && h.value !== "week" && !n.value && !y.value && !b.value), Ge = O(() => f.value && !u.value), Qe = O(() => u.value && !f.value), Xe = O(() => ({
|
|
960
|
+
dates: Ae.value,
|
|
961
|
+
daysInWeek: S.value,
|
|
962
|
+
enableKeyboadNavigate: W.value,
|
|
963
|
+
enableMarkCurrent: R.value,
|
|
964
|
+
enablePeriod: r.value,
|
|
965
|
+
firstDayOfTheWeek: L.value,
|
|
966
|
+
selected: F.value,
|
|
967
|
+
selectedPeriod: K.value,
|
|
968
|
+
selectedWeek: _.value,
|
|
969
|
+
selectMode: h.value,
|
|
970
|
+
showWeekNumber: $.value,
|
|
971
|
+
weekTitle: U.value
|
|
972
|
+
})), Ze = O(() => ({
|
|
973
|
+
dates: D,
|
|
974
|
+
daysInWeek: S.value,
|
|
975
|
+
enableKeyboadNavigate: W.value,
|
|
976
|
+
enableMarkCurrent: R.value,
|
|
977
|
+
enablePeriod: r.value,
|
|
978
|
+
firstDayOfTheWeek: L.value,
|
|
979
|
+
selected: F.value,
|
|
980
|
+
selectedPeriod: K.value,
|
|
981
|
+
selectMode: $.value,
|
|
982
|
+
showWeekNumber: $.value,
|
|
983
|
+
weekTitle: U.value
|
|
984
|
+
}));
|
|
985
|
+
function et(P, j) {
|
|
986
|
+
F.value = P, l.emit("datePicked", `${P.year}-${P.month}-${P.day}`);
|
|
987
|
+
}
|
|
988
|
+
function Yt(P) {
|
|
989
|
+
}
|
|
990
|
+
function It(P) {
|
|
991
|
+
}
|
|
992
|
+
function Et(P, j) {
|
|
993
|
+
}
|
|
994
|
+
function Wt(P, j) {
|
|
995
|
+
}
|
|
996
|
+
function ke(P, j) {
|
|
997
|
+
return me.value && v(oe, ee(j, {
|
|
998
|
+
onClick: (w) => et(w),
|
|
999
|
+
onClickWeek: (w) => void 0,
|
|
1000
|
+
onKeyDown: (w) => void 0,
|
|
1001
|
+
onMouseEnter: (w) => void 0,
|
|
1002
|
+
onMouseLeave: (w) => void 0
|
|
1003
|
+
}), null);
|
|
1004
|
+
}
|
|
1005
|
+
const tt = O(() => ({
|
|
1006
|
+
months: Re.value,
|
|
1007
|
+
enableMarkCurrent: R.value,
|
|
1008
|
+
enableKeyboadNavigate: W.value,
|
|
1009
|
+
enablePeriod: r.value,
|
|
1010
|
+
selected: T.value,
|
|
1011
|
+
selectedPeriod: K.value
|
|
1012
|
+
})), at = O(() => ({
|
|
1013
|
+
months: a.value,
|
|
1014
|
+
enableMarkCurrent: R.value,
|
|
1015
|
+
enableKeyboadNavigate: W.value,
|
|
1016
|
+
enablePeriod: r.value,
|
|
1017
|
+
selected: T.value,
|
|
1018
|
+
selectedPeriod: K.value
|
|
1019
|
+
}));
|
|
1020
|
+
function nt(P, j) {
|
|
1021
|
+
f.value = !1, u.value = !1, T.value = P, Y.value = {
|
|
1022
|
+
month: P.month || 1,
|
|
1023
|
+
displayTextOfMonth: d.value[Y.value.month || "1"],
|
|
1024
|
+
year: Y.value.year || 1,
|
|
1025
|
+
displayTextOfYear: `${Y.value.displayTextOfYear}`
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
function $t(P) {
|
|
1029
|
+
}
|
|
1030
|
+
function jt(P, j) {
|
|
1031
|
+
}
|
|
1032
|
+
function At(P, j) {
|
|
1033
|
+
}
|
|
1034
|
+
function ge(P, j) {
|
|
1035
|
+
return v(re, ee(j, {
|
|
1036
|
+
onClick: (w) => nt(w),
|
|
1037
|
+
onKeyDownMonthView: (w) => void 0,
|
|
1038
|
+
onMouseEnterMonthView: (w) => void 0,
|
|
1039
|
+
onMouseLeaveMonthView: (w) => void 0
|
|
1040
|
+
}), null);
|
|
1041
|
+
}
|
|
1042
|
+
const ot = O(() => ({
|
|
1043
|
+
years: ye.value,
|
|
1044
|
+
enableKeyboadNavigate: W.value,
|
|
1045
|
+
enableMarkCurrent: R.value,
|
|
1046
|
+
enablePeriod: r.value,
|
|
1047
|
+
selected: F.value,
|
|
1048
|
+
selectedPeriod: K.value
|
|
1049
|
+
})), lt = O(() => ({
|
|
1050
|
+
years: t.value,
|
|
1051
|
+
enableKeyboadNavigate: W.value,
|
|
1052
|
+
enableMarkCurrent: R.value,
|
|
1053
|
+
enablePeriod: r.value,
|
|
1054
|
+
selected: F.value,
|
|
1055
|
+
selectedPeriod: K.value
|
|
1056
|
+
}));
|
|
1057
|
+
function rt(P, j) {
|
|
1058
|
+
f.value = !0, u.value = !1, Y.value = {
|
|
1059
|
+
month: Y.value.month,
|
|
1060
|
+
displayTextOfMonth: Y.value.displayTextOfMonth,
|
|
1061
|
+
year: P.year || 1,
|
|
1062
|
+
displayTextOfYear: `${P.year}`
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
function Rt(P) {
|
|
1066
|
+
}
|
|
1067
|
+
function Lt(P, j) {
|
|
1068
|
+
}
|
|
1069
|
+
function Ft(P, j) {
|
|
1070
|
+
}
|
|
1071
|
+
function ut(P) {
|
|
1072
|
+
Y.value = {
|
|
1073
|
+
year: E.year || 1,
|
|
1074
|
+
month: E.month || 1,
|
|
1075
|
+
displayTextOfMonth: d.value[E.month || "1"],
|
|
1076
|
+
displayTextOfYear: `${E.year}`
|
|
1077
|
+
}, F.value = E;
|
|
1078
|
+
}
|
|
1079
|
+
function st(P) {
|
|
1080
|
+
Y.value = {
|
|
1081
|
+
year: E.year || 1,
|
|
1082
|
+
month: E.month || 1,
|
|
1083
|
+
displayTextOfMonth: d.value[E.month || "1"],
|
|
1084
|
+
displayTextOfYear: `${E.year}`
|
|
1085
|
+
}, F.value = E, T.value = {
|
|
1086
|
+
year: E.year,
|
|
1087
|
+
month: E.month
|
|
1088
|
+
};
|
|
1089
|
+
}
|
|
1090
|
+
function it(P) {
|
|
1091
|
+
Y.value = {
|
|
1092
|
+
year: E.year || 1,
|
|
1093
|
+
month: E.month || 1,
|
|
1094
|
+
displayTextOfMonth: d.value[E.month || "1"],
|
|
1095
|
+
displayTextOfYear: `${E.year}`
|
|
1096
|
+
}, F.value = E;
|
|
1097
|
+
}
|
|
1098
|
+
const ct = O(() => r.value && h.value !== "week");
|
|
1099
|
+
function pe(P, j) {
|
|
1100
|
+
return v(ue, ee(j, {
|
|
1101
|
+
onClick: (w) => rt(w),
|
|
1102
|
+
onKeyDownYearView: (w) => void 0,
|
|
1103
|
+
onClickPreRecord: (w) => ve(),
|
|
1104
|
+
onClickNextRecord: (w) => he(),
|
|
1105
|
+
onMouseEnterYearView: (w) => void 0,
|
|
1106
|
+
onMouseLeaveYearView: (w) => void 0
|
|
1107
|
+
}), null);
|
|
1108
|
+
}
|
|
1109
|
+
return () => v("div", {
|
|
1110
|
+
class: Le.value,
|
|
1111
|
+
style: Ve.value,
|
|
1112
|
+
tabindex: "0",
|
|
1113
|
+
onKeyup: (P) => void 0,
|
|
1114
|
+
onClick: (P) => Ke(P)
|
|
1115
|
+
}, [v("div", {
|
|
1116
|
+
class: "f-datepicker-content"
|
|
1117
|
+
}, [be(!1, He.value), ke(!1, Xe.value), f.value && ge(!1, tt.value), u.value && pe(!1, ot.value), v("div", {
|
|
1118
|
+
class: "f-datepicker-footer"
|
|
1119
|
+
}, [v("div", {
|
|
1120
|
+
class: "f-datepicker-redirect"
|
|
1121
|
+
}, [me.value && v("button", {
|
|
1122
|
+
class: "btn btn-link",
|
|
1123
|
+
onClick: ut
|
|
1124
|
+
}, [ne("\u4ECA\u5929")]), Ge.value && v("button", {
|
|
1125
|
+
class: "btn btn-link",
|
|
1126
|
+
onClick: st
|
|
1127
|
+
}, [ne("\u672C\u6708")]), Qe.value && v("button", {
|
|
1128
|
+
class: "btn btn-link",
|
|
1129
|
+
onClick: it
|
|
1130
|
+
}, [ne("\u4ECA\u5E74")])])])]), ct.value && v("div", {
|
|
1131
|
+
class: "f-datepicker-content"
|
|
1132
|
+
}, [be(!0, Je.value), ke(!0, Ze.value), n.value && ge(!0, at.value), y.value && pe(!0, lt.value)])]);
|
|
1133
|
+
}
|
|
1134
|
+
}), xt = {
|
|
1135
|
+
displayFormat: { Type: String, default: "yyyyMMdd" },
|
|
1136
|
+
minYear: { Type: Number, default: 1 },
|
|
1137
|
+
maxYear: { Type: Number, default: 2500 },
|
|
1138
|
+
valueFormat: { Type: String, default: "yyyyMMdd" },
|
|
1139
|
+
displayTime: { Type: Boolean, default: !1 },
|
|
1140
|
+
selectMode: { Type: String, default: "day" },
|
|
1141
|
+
disableUntil: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
1142
|
+
disableSince: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
1143
|
+
disableDates: { Type: Array, default: [] },
|
|
1144
|
+
disablePeriod: { Type: Array, default: [] },
|
|
1145
|
+
disableWeekends: { Type: Boolean, default: !1 },
|
|
1146
|
+
disableWeekdays: { Type: Array, default: [] },
|
|
1147
|
+
highlightDates: { Type: Array, default: [] },
|
|
1148
|
+
highlightSaturday: { Type: Boolean, default: !1 },
|
|
1149
|
+
highlightSunday: { Type: Boolean, default: !1 },
|
|
1150
|
+
modelValue: { type: String, default: "" },
|
|
1151
|
+
nameOfMonths: { Type: Object, default: Te },
|
|
1152
|
+
periodDelimiter: { Type: String, default: "" }
|
|
1153
|
+
}, Ct = {
|
|
1154
|
+
id: String,
|
|
1155
|
+
buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
|
|
1156
|
+
autoComplete: { type: Boolean, default: !1 },
|
|
1157
|
+
customClass: { type: String, default: "" },
|
|
1158
|
+
disable: { type: Boolean, default: !1 },
|
|
1159
|
+
editable: { type: Boolean, default: !0 },
|
|
1160
|
+
enableClear: { type: Boolean, default: !1 },
|
|
1161
|
+
modelValue: { type: String, default: "" },
|
|
1162
|
+
readonly: { type: Boolean, default: !1 },
|
|
1163
|
+
textAlign: { type: String, default: "left" },
|
|
1164
|
+
showButtonWhenDisabled: { type: Boolean, default: !1 },
|
|
1165
|
+
enableTitle: { type: Boolean, default: !1 },
|
|
1166
|
+
inputType: { type: String, default: "text" },
|
|
1167
|
+
forcePlaceholder: { type: Boolean, default: !1 },
|
|
1168
|
+
placeholder: { type: String, default: "" },
|
|
1169
|
+
minLength: Number,
|
|
1170
|
+
maxLength: Number,
|
|
1171
|
+
tabIndex: Number
|
|
1172
|
+
};
|
|
1173
|
+
function Dt(e, l, s) {
|
|
1174
|
+
const k = O(() => ({
|
|
1175
|
+
"input-group-append": !0,
|
|
1176
|
+
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
1177
|
+
})), i = O(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable);
|
|
1178
|
+
function r(t) {
|
|
1179
|
+
i.value && (s.value = !0, l.emit("clickButton", { origin: t, value: e.modelValue })), t.stopPropagation();
|
|
1180
|
+
}
|
|
1181
|
+
function h(t) {
|
|
1182
|
+
l.emit("mouseEnterIcon", t);
|
|
1183
|
+
}
|
|
1184
|
+
function c(t) {
|
|
1185
|
+
l.emit("mouseLeaveIcon", t);
|
|
1186
|
+
}
|
|
1187
|
+
function d() {
|
|
1188
|
+
l.emit("mouseOverButton");
|
|
1189
|
+
}
|
|
1190
|
+
return {
|
|
1191
|
+
buttonClass: k,
|
|
1192
|
+
onClickButton: r,
|
|
1193
|
+
onMouseEnterButton: h,
|
|
1194
|
+
onMouseLeaveButton: c,
|
|
1195
|
+
onMouseOverButton: d
|
|
1196
|
+
};
|
|
1197
|
+
}
|
|
1198
|
+
function Ce(e, l, s, k) {
|
|
1199
|
+
const i = O(() => e.enableTitle ? s.value : ""), r = O(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), h = O(() => e.readonly || !e.editable);
|
|
1200
|
+
let c = !1;
|
|
1201
|
+
const d = O(() => !e.disable && c), t = O(() => ({
|
|
1202
|
+
"text-left": e.textAlign === "left",
|
|
1203
|
+
"text-center": e.textAlign === "center",
|
|
1204
|
+
"text-right": e.textAlign === "right",
|
|
1205
|
+
"form-control": !0,
|
|
1206
|
+
"f-utils-fill": !0
|
|
1207
|
+
}));
|
|
1208
|
+
function f(g, p = !0) {
|
|
1209
|
+
s.value !== g && (s.value = g, p && l.emit("change", g), l.emit("update:modelValue", g));
|
|
1210
|
+
}
|
|
1211
|
+
J(
|
|
1212
|
+
() => e.modelValue,
|
|
1213
|
+
(g) => {
|
|
1214
|
+
s.value = g, l.emit("change", g);
|
|
1215
|
+
}
|
|
1216
|
+
);
|
|
1217
|
+
function n(g) {
|
|
1218
|
+
c = !1, l.emit("blur", g), g.stopPropagation();
|
|
1219
|
+
}
|
|
1220
|
+
function u(g) {
|
|
1221
|
+
l.emit("click", g);
|
|
1222
|
+
}
|
|
1223
|
+
function y(g) {
|
|
1224
|
+
if (e.disable) {
|
|
1225
|
+
c = !0;
|
|
1226
|
+
return;
|
|
1227
|
+
}
|
|
1228
|
+
c = !0, h.value || l.emit("focus", g);
|
|
1229
|
+
}
|
|
1230
|
+
function b(g) {
|
|
1231
|
+
l.emit("input", g.target.value);
|
|
1232
|
+
const p = g.target.value;
|
|
1233
|
+
k.value = p, s.value !== p && f(p, !1);
|
|
1234
|
+
}
|
|
1235
|
+
function I(g) {
|
|
1236
|
+
g.target.tagName !== "INPUT" && g.preventDefault(), g.stopPropagation();
|
|
1237
|
+
}
|
|
1238
|
+
function B(g) {
|
|
1239
|
+
l.emit("keydown", g);
|
|
1240
|
+
}
|
|
1241
|
+
function x(g) {
|
|
1242
|
+
l.emit("keyup", g);
|
|
1243
|
+
}
|
|
1244
|
+
function N(g) {
|
|
1245
|
+
const p = g.target.value;
|
|
1246
|
+
f(p);
|
|
1247
|
+
}
|
|
1248
|
+
return {
|
|
1249
|
+
hasFocusedTextBox: d,
|
|
1250
|
+
isTextBoxReadonly: h,
|
|
1251
|
+
textBoxClass: t,
|
|
1252
|
+
textBoxPlaceholder: r,
|
|
1253
|
+
textBoxTitle: i,
|
|
1254
|
+
changeTextBoxValue: f,
|
|
1255
|
+
onBlurTextBox: n,
|
|
1256
|
+
onClickTextBox: u,
|
|
1257
|
+
onFocusTextBox: y,
|
|
1258
|
+
onInput: b,
|
|
1259
|
+
onKeyDownTextBox: B,
|
|
1260
|
+
onKeyUpTextBox: x,
|
|
1261
|
+
onMouseDownTextBox: I,
|
|
1262
|
+
onTextBoxValueChange: N
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
function Bt(e, l, s, k, i) {
|
|
1266
|
+
const r = o(!1), h = O(() => e.enableClear && !e.readonly && !e.disable), { changeTextBoxValue: c } = Ce(e, l, s, i);
|
|
1267
|
+
function d(u) {
|
|
1268
|
+
r.value = u;
|
|
1269
|
+
}
|
|
1270
|
+
J(i, () => {
|
|
1271
|
+
k.value ? d(!!i.value) : d(!1);
|
|
1272
|
+
});
|
|
1273
|
+
function t(u) {
|
|
1274
|
+
const y = !e.readonly && !e.disable && e.editable, b = !e.editable;
|
|
1275
|
+
u.stopPropagation(), (y || b) && (c("", !1), d(!r.value), l.emit("clear"));
|
|
1276
|
+
}
|
|
1277
|
+
function f(u) {
|
|
1278
|
+
if (!!h.value) {
|
|
1279
|
+
if (!s.value) {
|
|
1280
|
+
d(!1);
|
|
1281
|
+
return;
|
|
1282
|
+
}
|
|
1283
|
+
(!e.editable || !e.readonly) && !e.disable && d(!0);
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
function n(u) {
|
|
1287
|
+
!h.value || d(!1);
|
|
1288
|
+
}
|
|
1289
|
+
return {
|
|
1290
|
+
enableClearButton: h,
|
|
1291
|
+
showClearButton: r,
|
|
1292
|
+
onClearValue: t,
|
|
1293
|
+
onMouseEnterTextBox: f,
|
|
1294
|
+
onMouseLeaveTextBox: n
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
const wt = {
|
|
1298
|
+
popupContentPosition: { type: Object, default: { left: 0, top: 0 } }
|
|
1299
|
+
}, Ot = G({
|
|
1300
|
+
name: "FOverlay",
|
|
1301
|
+
props: wt,
|
|
1302
|
+
emits: ["click"],
|
|
1303
|
+
setup(e, l) {
|
|
1304
|
+
const s = o(e.popupContentPosition);
|
|
1305
|
+
function k(r) {
|
|
1306
|
+
l.emit("click"), r.preventDefault(), r.stopPropagation();
|
|
1307
|
+
}
|
|
1308
|
+
const i = O(() => ({
|
|
1309
|
+
position: "relative",
|
|
1310
|
+
left: `${s.value.left}px`,
|
|
1311
|
+
top: `${s.value.top}px`
|
|
1312
|
+
}));
|
|
1313
|
+
return () => v(dt, {
|
|
1314
|
+
to: "body"
|
|
1315
|
+
}, {
|
|
1316
|
+
default: () => {
|
|
1317
|
+
var r, h;
|
|
1318
|
+
return [v("div", {
|
|
1319
|
+
class: "overlay-container",
|
|
1320
|
+
style: "pointer-events: auto;",
|
|
1321
|
+
onClick: (c) => k(c)
|
|
1322
|
+
}, [v("div", {
|
|
1323
|
+
style: i.value
|
|
1324
|
+
}, [(h = (r = l.slots).default) == null ? void 0 : h.call(r)])])];
|
|
1325
|
+
}
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
}), Nt = G({
|
|
1329
|
+
name: "FButtonEdit",
|
|
1330
|
+
props: Ct,
|
|
1331
|
+
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
|
|
1332
|
+
setup(e, l) {
|
|
1333
|
+
const s = o(), k = o(e.modelValue), i = o(!1), {
|
|
1334
|
+
buttonClass: r,
|
|
1335
|
+
onClickButton: h,
|
|
1336
|
+
onMouseEnterButton: c,
|
|
1337
|
+
onMouseLeaveButton: d
|
|
1338
|
+
} = Dt(e, l, i), t = o(""), {
|
|
1339
|
+
hasFocusedTextBox: f,
|
|
1340
|
+
isTextBoxReadonly: n,
|
|
1341
|
+
textBoxClass: u,
|
|
1342
|
+
textBoxPlaceholder: y,
|
|
1343
|
+
textBoxTitle: b,
|
|
1344
|
+
onBlurTextBox: I,
|
|
1345
|
+
onClickTextBox: B,
|
|
1346
|
+
onFocusTextBox: x,
|
|
1347
|
+
onInput: N,
|
|
1348
|
+
onKeyDownTextBox: g,
|
|
1349
|
+
onKeyUpTextBox: p,
|
|
1350
|
+
onMouseDownTextBox: C,
|
|
1351
|
+
onTextBoxValueChange: m
|
|
1352
|
+
} = Ce(e, l, k, t), {
|
|
1353
|
+
enableClearButton: D,
|
|
1354
|
+
showClearButton: S,
|
|
1355
|
+
onClearValue: W,
|
|
1356
|
+
onMouseEnterTextBox: R,
|
|
1357
|
+
onMouseLeaveTextBox: L
|
|
1358
|
+
} = Bt(e, l, k, f, t), $ = O(() => ({
|
|
1359
|
+
"input-group": !0,
|
|
1360
|
+
"f-state-disable": e.disable,
|
|
1361
|
+
"f-state-editable": e.editable && !e.disable && !e.readonly,
|
|
1362
|
+
"f-state-readonly": e.readonly && !e.disable,
|
|
1363
|
+
"f-state-focus": f
|
|
1364
|
+
}));
|
|
1365
|
+
function F() {
|
|
1366
|
+
i.value = !1;
|
|
1367
|
+
}
|
|
1368
|
+
const _ = O(() => i.value), K = () => {
|
|
1369
|
+
if (s.value) {
|
|
1370
|
+
const a = s.value.getBoundingClientRect(), {
|
|
1371
|
+
left: T,
|
|
1372
|
+
top: M,
|
|
1373
|
+
height: A
|
|
1374
|
+
} = a;
|
|
1375
|
+
return {
|
|
1376
|
+
left: T,
|
|
1377
|
+
top: M + A
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1380
|
+
return {
|
|
1381
|
+
left: 0,
|
|
1382
|
+
top: 0
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1385
|
+
function U(a) {
|
|
1386
|
+
i.value = !1;
|
|
1387
|
+
}
|
|
1388
|
+
return l.expose({
|
|
1389
|
+
commitValue: U
|
|
1390
|
+
}), () => v(se, null, [v("div", ee(l.attrs, {
|
|
1391
|
+
ref: s,
|
|
1392
|
+
class: "f-cmp-inputgroup",
|
|
1393
|
+
id: e.id
|
|
1394
|
+
}), [v("div", {
|
|
1395
|
+
class: [e.customClass, $.value],
|
|
1396
|
+
onMouseenter: R,
|
|
1397
|
+
onMouseleave: L
|
|
1398
|
+
}, [v("input", {
|
|
1399
|
+
name: "input-group-value",
|
|
1400
|
+
autocomplete: "" + e.autoComplete,
|
|
1401
|
+
class: u.value,
|
|
1402
|
+
disabled: e.disable,
|
|
1403
|
+
maxlength: e.maxLength,
|
|
1404
|
+
minlength: e.minLength,
|
|
1405
|
+
placeholder: y.value,
|
|
1406
|
+
readonly: n.value,
|
|
1407
|
+
tabindex: e.tabIndex,
|
|
1408
|
+
title: b.value,
|
|
1409
|
+
type: e.inputType,
|
|
1410
|
+
value: k.value,
|
|
1411
|
+
onBlur: I,
|
|
1412
|
+
onChange: m,
|
|
1413
|
+
onClick: B,
|
|
1414
|
+
onFocus: x,
|
|
1415
|
+
onInput: N,
|
|
1416
|
+
onKeydown: g,
|
|
1417
|
+
onKeyup: p,
|
|
1418
|
+
onMousedown: C
|
|
1419
|
+
}, null), v("div", {
|
|
1420
|
+
class: r.value
|
|
1421
|
+
}, [D.value && ft(v("span", {
|
|
1422
|
+
class: "input-group-text input-group-clear",
|
|
1423
|
+
onClick: W
|
|
1424
|
+
}, [v("i", {
|
|
1425
|
+
class: "f-icon modal_close"
|
|
1426
|
+
}, null)]), [[yt, S.value]]), e.buttonContent && v("span", {
|
|
1427
|
+
class: "input-group-text input-group-append-button",
|
|
1428
|
+
onClick: h,
|
|
1429
|
+
onMouseenter: c,
|
|
1430
|
+
onMouseleave: d,
|
|
1431
|
+
innerHTML: e.buttonContent
|
|
1432
|
+
}, null)])])]), _.value && v(Ot, {
|
|
1433
|
+
"popup-content-position": K(),
|
|
1434
|
+
onClick: F
|
|
1435
|
+
}, {
|
|
1436
|
+
default: () => {
|
|
1437
|
+
var a, T;
|
|
1438
|
+
return [(T = (a = l.slots).default) == null ? void 0 : T.call(a)];
|
|
1439
|
+
}
|
|
1440
|
+
})]);
|
|
1441
|
+
}
|
|
1442
|
+
}), Pe = G({
|
|
1443
|
+
name: "FDatePicker",
|
|
1444
|
+
props: xt,
|
|
1445
|
+
emits: ["update:modelValue", "datePicked"],
|
|
1446
|
+
setup(e, l) {
|
|
1447
|
+
const s = '<span class="f-icon f-icon-date"></span>', k = o(e.modelValue), i = o(null);
|
|
1448
|
+
function r() {
|
|
1449
|
+
}
|
|
1450
|
+
function h(c) {
|
|
1451
|
+
var d;
|
|
1452
|
+
k.value = c, l.emit("update:modelValue", c), l.emit("datePicked", c), (d = i.value) == null || d.commitValue(c);
|
|
1453
|
+
}
|
|
1454
|
+
return () => v(se, null, [v(Nt, {
|
|
1455
|
+
ref: i,
|
|
1456
|
+
modelValue: k.value,
|
|
1457
|
+
"onUpdate:modelValue": (c) => k.value = c,
|
|
1458
|
+
buttonContent: s,
|
|
1459
|
+
enableClear: !0,
|
|
1460
|
+
onClickButton: () => void 0
|
|
1461
|
+
}, {
|
|
1462
|
+
default: () => [v(vt("f-date-picker-container"), {
|
|
1463
|
+
onDatePicked: (c) => h(c)
|
|
1464
|
+
}, null)]
|
|
1465
|
+
})]);
|
|
1466
|
+
}
|
|
1467
|
+
}), Kt = {
|
|
1468
|
+
install(e) {
|
|
1469
|
+
e.component(oe.name, oe).component(le.name, le).component(Me.name, Me).component(re.name, re).component(ue.name, ue).component(Pe.name, Pe);
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
export {
|
|
1473
|
+
oe as DatePickerCalendar,
|
|
1474
|
+
q as MonthTag,
|
|
1475
|
+
ht as datePickerCalendarProps,
|
|
1476
|
+
Kt as default,
|
|
1477
|
+
Te as defaultNameOfMonths,
|
|
1478
|
+
ae as weekDays
|
|
1479
|
+
};
|