@farris/ui-vue 1.5.7 → 1.5.9
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/components/avatar/index.esm.js +5 -5
- package/components/avatar/index.umd.cjs +1 -1
- package/components/component/index.esm.js +5 -5
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +5 -5
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +5 -5
- package/components/content-container/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +1082 -1421
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +908 -897
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dynamic-form/index.esm.js +5 -5
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +5 -5
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +5 -5
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +13 -12
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +5 -5
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +5 -5
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +5 -5
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +862 -3625
- package/components/page-header/index.umd.cjs +1 -1
- package/components/property-panel/index.esm.js +5 -5
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +77 -76
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/response-layout/index.esm.js +5 -5
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +500 -3662
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +3008 -7347
- package/components/schema-selector/index.umd.cjs +6 -6
- package/components/section/index.esm.js +117 -7544
- package/components/section/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +545 -4943
- package/components/tabs/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +100 -5841
- package/components/textarea/index.umd.cjs +2 -2
- package/components/time-picker/index.esm.js +5 -5
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/video/index.esm.js +5 -5
- package/components/video/index.umd.cjs +1 -1
- package/designer/button-edit/index.css +1 -0
- package/designer/button-edit/index.esm.js +1556 -0
- package/designer/button-edit/index.umd.cjs +1 -0
- package/designer/checkbox/index.esm.js +207 -0
- package/designer/checkbox/index.umd.cjs +1 -0
- package/designer/checkbox-group/index.esm.js +377 -0
- package/designer/checkbox-group/index.umd.cjs +1 -0
- package/designer/data-grid/index.css +1 -0
- package/designer/data-grid/index.esm.js +14332 -0
- package/designer/data-grid/index.umd.cjs +20 -0
- package/designer/data-view/index.esm.js +271 -0
- package/designer/data-view/index.umd.cjs +1 -0
- package/designer/date-picker/index.esm.js +1879 -0
- package/designer/date-picker/index.umd.cjs +1 -0
- package/designer/drawer/index.css +1 -0
- package/designer/drawer/index.esm.js +463 -0
- package/designer/drawer/index.umd.cjs +1 -0
- package/designer/farris-designer.all.esm.js +16827 -0
- package/designer/farris-designer.all.umd.cjs +32 -0
- package/designer/index.css +1 -0
- package/designer/input-group/index.esm.js +647 -0
- package/designer/input-group/index.umd.cjs +1 -0
- package/designer/radio-group/index.esm.js +6959 -0
- package/designer/radio-group/index.umd.cjs +1 -0
- package/designer/response-toolbar/index.esm.js +3015 -0
- package/designer/response-toolbar/index.umd.cjs +1 -0
- package/designer/section/index.esm.js +744 -0
- package/designer/section/index.umd.cjs +1 -0
- package/designer/tabs/index.esm.js +2200 -0
- package/designer/tabs/index.umd.cjs +1 -0
- package/designer/textarea/index.esm.js +249 -0
- package/designer/textarea/index.umd.cjs +1 -0
- package/designer/tree-grid/index.css +1 -0
- package/designer/tree-grid/index.esm.js +1673 -0
- package/designer/tree-grid/index.umd.cjs +1 -0
- package/farris.all.esm.js +30447 -30444
- package/farris.all.umd.cjs +16 -16
- package/package.json +1 -1
- package/types/date-picker/designer.d.ts +29 -0
- package/types/date-picker/index.d.ts +2 -1
- package/types/date-picker/src/date-picker.props.d.ts +0 -5
- package/types/date-picker/src/designer/date-picker.design.props.d.ts +22 -0
- package/types/designer-canvas/index.d.ts +2 -2
- package/types/response-toolbar/designer.d.ts +37 -0
- package/types/response-toolbar/index.d.ts +6 -5
- package/types/response-toolbar/src/composition/toolbar-item-dragula.d.ts +1 -2
- package/types/response-toolbar/src/composition/types.d.ts +1 -1
- package/types/response-toolbar/src/designer/response-toolbar.design.props.d.ts +13 -0
- package/types/response-toolbar/src/designer/use-designer-item-rules.d.ts +1 -2
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +1 -2
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -1
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -1
- package/types/response-toolbar/src/response-toolbar.props.d.ts +0 -12
- package/types/response-toolbar/src/schema/schema-resolver.d.ts +1 -1
- package/types/section/designer.d.ts +26 -0
- package/types/section/index.d.ts +1 -0
- package/types/section/src/designer/section-header.design.component.d.ts +2 -2
- package/types/section/src/designer/section-toolbar-item.design.props.d.ts +16 -0
- package/types/section/src/designer/section-toolbar-item.props.d.ts +0 -1
- package/types/section/src/designer/section-toolbar.design.component.d.ts +2 -2
- package/types/section/src/designer/section.design.props.d.ts +11 -0
- package/types/section/src/designer/use-designer-rules.d.ts +1 -2
- package/types/section/src/property-config/section.property-config.d.ts +1 -1
- package/types/section/src/schema/schema-resolver.d.ts +1 -1
- package/types/section/src/section.props.d.ts +0 -10
- package/types/tabs/designer.d.ts +28 -0
- package/types/tabs/index.d.ts +1 -0
- package/types/tabs/src/components/tab-page.props.d.ts +0 -1
- package/types/tabs/src/designer/tab-page.design.props.d.ts +1 -0
- package/types/tabs/src/designer/tabs.design.props.d.ts +12 -0
- package/types/tabs/src/tabs.props.d.ts +0 -11
- package/types/textarea/designer.d.ts +28 -0
- package/types/textarea/index.d.ts +0 -15
- package/types/textarea/src/designer/textarea.design.props.d.ts +6 -0
- package/types/textarea/src/designer/use-design-rules.d.ts +1 -2
- package/types/textarea/src/property-config/textarea.property-config.d.ts +1 -1
- package/types/textarea/src/schema/schema-resolver.d.ts +1 -1
- package/types/textarea/src/textarea.props.d.ts +0 -5
- package/components/textarea/index.css +0 -1
- /package/{components/section → designer/radio-group}/index.css +0 -0
|
@@ -0,0 +1,1879 @@
|
|
|
1
|
+
import { useDateFormat as Vt, formatTime as Lt, getTimeObject as Kt, withInstall as _t } from "../../components/common/index.esm.js";
|
|
2
|
+
import { datePickerProps as Ye, DatePicker as qt, DatePickerContainer as zt } from "../../components/date-picker/index.esm.js";
|
|
3
|
+
import { defineComponent as Z, ref as r, inject as Me, onMounted as ge, createVNode as m, watch as J, computed as B, Fragment as Ut, watchEffect as Gt, createTextVNode as ie, mergeProps as ue } from "vue";
|
|
4
|
+
import Xt from "../button-edit/index.esm.js";
|
|
5
|
+
import { useDesignerComponent as Fe } from "../../components/designer-canvas/index.esm.js";
|
|
6
|
+
import { resolveAppearance as Jt, createPropsResolver as Ie } from "../../components/dynamic-resolver/index.esm.js";
|
|
7
|
+
import { InputBaseProperty as Qt } from "../../components/property-panel/index.esm.js";
|
|
8
|
+
import { cloneDeep as oe } from "lodash-es";
|
|
9
|
+
import { FTimePickerTimeView as Zt } from "../../components/time-picker/index.esm.js";
|
|
10
|
+
import { FButton as ea } from "../../components/button/index.esm.js";
|
|
11
|
+
function $e(e, a, n) {
|
|
12
|
+
return a;
|
|
13
|
+
}
|
|
14
|
+
const Ee = /* @__PURE__ */ new Map([
|
|
15
|
+
["appearance", Jt]
|
|
16
|
+
]), ta = "https://json-schema.org/draft/2020-12/schema", aa = "https://farris-design.gitee.io/date-picker.schema.json", na = "date-picker", oa = "A Farris Input Component", la = "object", ra = {
|
|
17
|
+
id: {
|
|
18
|
+
description: "The unique identifier for date picker",
|
|
19
|
+
type: "string"
|
|
20
|
+
},
|
|
21
|
+
type: {
|
|
22
|
+
description: "The type string of date picker",
|
|
23
|
+
type: "string",
|
|
24
|
+
default: "date-picker"
|
|
25
|
+
},
|
|
26
|
+
appearance: {
|
|
27
|
+
description: "",
|
|
28
|
+
type: "object",
|
|
29
|
+
properties: {
|
|
30
|
+
class: {
|
|
31
|
+
type: "string"
|
|
32
|
+
},
|
|
33
|
+
style: {
|
|
34
|
+
type: "string"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
default: {}
|
|
38
|
+
},
|
|
39
|
+
binding: {
|
|
40
|
+
description: "",
|
|
41
|
+
type: "object",
|
|
42
|
+
default: {}
|
|
43
|
+
},
|
|
44
|
+
disabled: {
|
|
45
|
+
type: "string",
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
editable: {
|
|
49
|
+
description: "",
|
|
50
|
+
type: "boolean",
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
placeholder: {
|
|
54
|
+
description: "",
|
|
55
|
+
type: "string",
|
|
56
|
+
default: "请选择日期"
|
|
57
|
+
},
|
|
58
|
+
readonly: {
|
|
59
|
+
description: "",
|
|
60
|
+
type: "boolean",
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
required: {
|
|
64
|
+
description: "",
|
|
65
|
+
type: "boolean",
|
|
66
|
+
default: !1
|
|
67
|
+
},
|
|
68
|
+
tabindex: {
|
|
69
|
+
description: "",
|
|
70
|
+
type: "number",
|
|
71
|
+
default: -1
|
|
72
|
+
},
|
|
73
|
+
visible: {
|
|
74
|
+
description: "",
|
|
75
|
+
type: "boolean",
|
|
76
|
+
default: !0
|
|
77
|
+
},
|
|
78
|
+
displayFormat: {
|
|
79
|
+
description: "",
|
|
80
|
+
type: "enum",
|
|
81
|
+
default: "yyyy-MM-dd"
|
|
82
|
+
},
|
|
83
|
+
valueFormat: {
|
|
84
|
+
description: "",
|
|
85
|
+
type: "enum",
|
|
86
|
+
default: "yyyy-MM-dd"
|
|
87
|
+
},
|
|
88
|
+
maxDate: {
|
|
89
|
+
description: "",
|
|
90
|
+
type: "string"
|
|
91
|
+
},
|
|
92
|
+
minDate: {
|
|
93
|
+
description: "",
|
|
94
|
+
type: "string"
|
|
95
|
+
},
|
|
96
|
+
showTime: {
|
|
97
|
+
description: "",
|
|
98
|
+
type: "boolean",
|
|
99
|
+
default: !1
|
|
100
|
+
}
|
|
101
|
+
}, sa = [
|
|
102
|
+
"type"
|
|
103
|
+
], ia = [
|
|
104
|
+
"id",
|
|
105
|
+
"appearance",
|
|
106
|
+
"binding",
|
|
107
|
+
"visible"
|
|
108
|
+
], ua = {
|
|
109
|
+
$schema: ta,
|
|
110
|
+
$id: aa,
|
|
111
|
+
title: na,
|
|
112
|
+
description: oa,
|
|
113
|
+
type: la,
|
|
114
|
+
properties: ra,
|
|
115
|
+
required: sa,
|
|
116
|
+
ignore: ia
|
|
117
|
+
}, fn = { year: 9999, month: 12, day: 31, hour: 23, minute: 59, second: 59 }, vn = { year: 1900, month: 1, day: 1, hour: 0, minute: 0, second: 0 }, da = Object.assign({}, Ye, {
|
|
118
|
+
readonly: {}
|
|
119
|
+
}), je = Ie(Ye, ua, Ee, $e);
|
|
120
|
+
function ca() {
|
|
121
|
+
let e = "zh-CHS";
|
|
122
|
+
window && window.top && window.top.localStorage && window.top.localStorage.languageCode && ({ languageCode: e } = window.top.localStorage);
|
|
123
|
+
const a = [
|
|
124
|
+
{ id: "yyyy-MM-dd HH:mm:ss", name: "yyyy-MM-dd HH:mm:ss" },
|
|
125
|
+
{ id: "yyyy/MM/dd HH:mm:ss", name: "yyyy/MM/dd HH:mm:ss" },
|
|
126
|
+
{ id: "yyyyMMddHHmmss", name: "yyyyMMddHHmmss" },
|
|
127
|
+
{ id: "yyyy-MM-dd HH:mm", name: "yyyy-MM-dd HH:mm" },
|
|
128
|
+
{ id: "yyyy/MM/dd HH:mm", name: "yyyy/MM/dd HH:mm" },
|
|
129
|
+
{ id: "yyyyMMddHHmm", name: "yyyyMMddHHmm" }
|
|
130
|
+
], n = [
|
|
131
|
+
{ id: "yyyy-MM-dd", name: "yyyy-MM-dd" },
|
|
132
|
+
{ id: "yyyy/MM/dd", name: "yyyy/MM/dd" },
|
|
133
|
+
{ id: "yyyyMMdd", name: "yyyyMMdd" },
|
|
134
|
+
{ id: "MM/dd/yyyy", name: "MM/dd/yyyy" }
|
|
135
|
+
], v = [
|
|
136
|
+
{ id: "yyyy-MM", name: "yyyy-MM" },
|
|
137
|
+
{ id: "yyyy/MM", name: "yyyy/MM" },
|
|
138
|
+
{ id: "yyyyMM", name: "yyyyMM" }
|
|
139
|
+
], s = [
|
|
140
|
+
{ id: "MM/dd", name: "MM/dd" },
|
|
141
|
+
{ id: "MMdd", name: "MMdd" },
|
|
142
|
+
{ id: "MM-dd", name: "MM-dd" }
|
|
143
|
+
], d = [
|
|
144
|
+
{ id: "yyyy", name: "yyyy" }
|
|
145
|
+
];
|
|
146
|
+
return e === "zh-CHS" && (a.push(
|
|
147
|
+
{ id: "yyyy年MM月dd日 HH时mm分ss秒", name: "yyyy年MM月dd日 HH时mm分ss秒" },
|
|
148
|
+
{ id: "yyyy年MM月dd日 HH时mm分", name: "yyyy年MM月dd日 HH时mm分" }
|
|
149
|
+
), n.push(
|
|
150
|
+
{ id: "yyyy年MM月dd日", name: "yyyy年MM月dd日" }
|
|
151
|
+
), v.push(
|
|
152
|
+
{ id: "yyyy年MM月", name: "yyyy年MM月" }
|
|
153
|
+
), s.push(
|
|
154
|
+
{ id: "MM月dd日", name: "MM月dd日" }
|
|
155
|
+
), d.push(
|
|
156
|
+
{ id: "yyyy年", name: "yyyy年" }
|
|
157
|
+
)), e === "zh-CHT" && (a.push(
|
|
158
|
+
{ id: "yyyy年MM月dd日 HH時mm分ss秒", name: "yyyy年MM月dd日 HH時mm分ss秒" },
|
|
159
|
+
{ id: "yyyy年MM月dd日 HH時mm分", name: "yyyy年MM月dd日 HH時mm分" }
|
|
160
|
+
), n.push(
|
|
161
|
+
{ id: "yyyy年MM月dd日", name: "yyyy年MM月dd日" }
|
|
162
|
+
), v.push(
|
|
163
|
+
{ id: "yyyy年MM月", name: "yyyy年MM月" }
|
|
164
|
+
), s.push(
|
|
165
|
+
{ id: "MM月dd日", name: "MM月dd日" }
|
|
166
|
+
), d.push(
|
|
167
|
+
{ id: "yyyy年", name: "yyyy年" }
|
|
168
|
+
)), { timeFormats: a, yMFormats: v, yMdFormats: n, mdFormats: s, yFormats: d };
|
|
169
|
+
}
|
|
170
|
+
class ya extends Qt {
|
|
171
|
+
constructor(a, n) {
|
|
172
|
+
super(a, n);
|
|
173
|
+
}
|
|
174
|
+
getEditorProperties(a) {
|
|
175
|
+
var s, d, T, g, f, M, k, l, c, t;
|
|
176
|
+
const n = this.getDateFormatOptions(a == null ? void 0 : a.editor), v = this.getValueFormatOptions();
|
|
177
|
+
return this.getComponentConfig(a, { type: "date-picker" }, {
|
|
178
|
+
showTime: {
|
|
179
|
+
description: "",
|
|
180
|
+
title: "启用时间选择",
|
|
181
|
+
type: "boolean",
|
|
182
|
+
readonly: ((s = a == null ? void 0 : a.editor) == null ? void 0 : s.fieldType) === "Date",
|
|
183
|
+
refreshPanelAfterChanged: !0
|
|
184
|
+
},
|
|
185
|
+
displayFormat: {
|
|
186
|
+
description: "",
|
|
187
|
+
title: "展示格式",
|
|
188
|
+
type: "enum",
|
|
189
|
+
editor: {
|
|
190
|
+
data: n
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
valueFormat: {
|
|
194
|
+
description: "",
|
|
195
|
+
title: "存储格式",
|
|
196
|
+
type: "enum",
|
|
197
|
+
editor: {
|
|
198
|
+
data: v
|
|
199
|
+
},
|
|
200
|
+
visible: ((d = a == null ? void 0 : a.editor) == null ? void 0 : d.fieldType) === "String"
|
|
201
|
+
},
|
|
202
|
+
maxDate: {
|
|
203
|
+
description: "",
|
|
204
|
+
title: "最大日期",
|
|
205
|
+
type: "string",
|
|
206
|
+
editor: {
|
|
207
|
+
type: "date-picker",
|
|
208
|
+
displayFormat: "yyyy-MM-dd" + ((T = a == null ? void 0 : a.editor) != null && T.showTime ? " HH:mm:ss" : ""),
|
|
209
|
+
valueFormat: "yyyy-MM-dd" + ((g = a == null ? void 0 : a.editor) != null && g.showTime ? " HH:mm:ss" : ""),
|
|
210
|
+
minDate: ((f = a == null ? void 0 : a.editor) == null ? void 0 : f.minDate) || "1900-01-01",
|
|
211
|
+
maxDate: "9999-12-31",
|
|
212
|
+
showTime: (M = a == null ? void 0 : a.editor) == null ? void 0 : M.showTime
|
|
213
|
+
},
|
|
214
|
+
refreshPanelAfterChanged: !0
|
|
215
|
+
},
|
|
216
|
+
minDate: {
|
|
217
|
+
description: "",
|
|
218
|
+
title: "最小日期",
|
|
219
|
+
type: "string",
|
|
220
|
+
editor: {
|
|
221
|
+
type: "date-picker",
|
|
222
|
+
displayFormat: "yyyy-MM-dd" + ((k = a == null ? void 0 : a.editor) != null && k.showTime ? " HH:mm:ss" : ""),
|
|
223
|
+
valueFormat: "yyyy-MM-dd" + ((l = a == null ? void 0 : a.editor) != null && l.showTime ? " HH:mm:ss" : ""),
|
|
224
|
+
minDate: "1900-01-01",
|
|
225
|
+
maxDate: ((c = a == null ? void 0 : a.editor) == null ? void 0 : c.maxDate) || "9999-12-31",
|
|
226
|
+
showTime: (t = a == null ? void 0 : a.editor) == null ? void 0 : t.showTime
|
|
227
|
+
},
|
|
228
|
+
refreshPanelAfterChanged: !0
|
|
229
|
+
}
|
|
230
|
+
}, this.setEditorPropertyRelates);
|
|
231
|
+
}
|
|
232
|
+
setEditorPropertyRelates(a, n, v) {
|
|
233
|
+
if (!(!a || !n.editor))
|
|
234
|
+
switch (a.propertyID) {
|
|
235
|
+
case "showTime": {
|
|
236
|
+
const s = n.editor;
|
|
237
|
+
a.propertyValue ? (s.displayFormat = "yyyy-MM-dd HH:mm:ss", s.valueFormat = "yyyy-MM-dd HH:mm:ss") : (s.displayFormat = "yyyy-MM-dd", s.valueFormat = "yyyy-MM-dd"), n.formatter && (n.formatter.dateFormat = s.displayFormat);
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
case "displayFormat": {
|
|
241
|
+
n.formatter && (n.formatter.dateFormat = a.propertyValue);
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
getDateFormatOptions(a) {
|
|
247
|
+
let n = [];
|
|
248
|
+
const { timeFormats: v, yMdFormats: s, yMFormats: d, mdFormats: T, yFormats: g } = ca();
|
|
249
|
+
return a.showTime && (n = n.concat(v)), n = n.concat(s), n = n.concat(d), n = n.concat(g), n = n.concat(T), n;
|
|
250
|
+
}
|
|
251
|
+
getValueFormatOptions() {
|
|
252
|
+
return [
|
|
253
|
+
{ id: "yyyy-MM-dd", name: "yyyy-MM-dd" },
|
|
254
|
+
{ id: "yyyy/MM/dd", name: "yyyy/MM/dd" },
|
|
255
|
+
{ id: "MM/dd/yyyy", name: "MM/dd/yyyy" },
|
|
256
|
+
{ id: "yyyy-MM-dd HH:mm:ss", name: "yyyy-MM-dd HH:mm:ss" },
|
|
257
|
+
{ id: "yyyy/MM/dd HH:mm:ss", name: "yyyy/MM/dd HH:mm:ss" },
|
|
258
|
+
{ id: "yyyyMM", name: "yyyyMM" },
|
|
259
|
+
{ id: "yyyy", name: "yyyy" }
|
|
260
|
+
];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function fa(e, a) {
|
|
264
|
+
const n = e.schema;
|
|
265
|
+
function v(s, d) {
|
|
266
|
+
return new ya(s, a).getPropertyConfig(n, d);
|
|
267
|
+
}
|
|
268
|
+
return { getPropsConfig: v };
|
|
269
|
+
}
|
|
270
|
+
const de = /* @__PURE__ */ Z({
|
|
271
|
+
name: "FDatePickerDesign",
|
|
272
|
+
props: da,
|
|
273
|
+
emits: ["update:modelValue", "datePicked"],
|
|
274
|
+
setup(e, a) {
|
|
275
|
+
const n = '<span class="f-icon f-icon-date"></span>', v = r(e.modelValue), s = r(), d = Me("designer-host-service"), T = Me("design-item-context"), g = fa(T, d), f = Fe(s, T, g);
|
|
276
|
+
return ge(() => {
|
|
277
|
+
s.value.componentInstance = f;
|
|
278
|
+
}), a.expose(f.value), () => m(Xt, {
|
|
279
|
+
ref: s,
|
|
280
|
+
modelValue: v.value,
|
|
281
|
+
"onUpdate:modelValue": (M) => v.value = M,
|
|
282
|
+
buttonContent: n,
|
|
283
|
+
readonly: !0,
|
|
284
|
+
editable: !1,
|
|
285
|
+
forcePlaceholder: !0,
|
|
286
|
+
placeholder: e.placeholder,
|
|
287
|
+
enableClear: !0
|
|
288
|
+
}, null);
|
|
289
|
+
}
|
|
290
|
+
}), Ae = {
|
|
291
|
+
1: "一月",
|
|
292
|
+
2: "二月",
|
|
293
|
+
3: "三月",
|
|
294
|
+
4: "四月",
|
|
295
|
+
5: "五月",
|
|
296
|
+
6: "六月",
|
|
297
|
+
7: "七月",
|
|
298
|
+
8: "八月",
|
|
299
|
+
9: "九月",
|
|
300
|
+
10: "十月",
|
|
301
|
+
11: "十一月",
|
|
302
|
+
12: "十二月"
|
|
303
|
+
}, va = {
|
|
304
|
+
/** 允许编辑 */
|
|
305
|
+
editable: { type: Boolean, default: !1 },
|
|
306
|
+
/** 禁用 */
|
|
307
|
+
disabled: { type: Boolean, default: !1 },
|
|
308
|
+
/** 同disabled */
|
|
309
|
+
readonly: { type: Boolean, default: !1 },
|
|
310
|
+
/** 禁用日期 */
|
|
311
|
+
disableDates: { Type: Array, default: [] },
|
|
312
|
+
/** 禁用范围 */
|
|
313
|
+
disablePeriod: { Type: Array, default: [] },
|
|
314
|
+
/** 自...禁用 */
|
|
315
|
+
disableSince: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
316
|
+
/** 禁用特定日 */
|
|
317
|
+
disableWeekdays: { Type: Array, default: [] },
|
|
318
|
+
/** 禁用周末 */
|
|
319
|
+
disableWeekends: { Type: Boolean, default: !1 },
|
|
320
|
+
/** 禁用至该范围 */
|
|
321
|
+
disableUntil: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
322
|
+
/** 是否显示时间 */
|
|
323
|
+
displayTime: { Type: Boolean, default: !1 },
|
|
324
|
+
/** 高亮日期 */
|
|
325
|
+
highlightDates: { Type: Array, default: [] },
|
|
326
|
+
/** 是否高亮周六 */
|
|
327
|
+
highlightSaturday: { Type: Boolean, default: !1 },
|
|
328
|
+
/** 是否高亮周日 */
|
|
329
|
+
highlightSunday: { Type: Boolean, default: !1 },
|
|
330
|
+
/** 最晚年限 */
|
|
331
|
+
maxDate: { Type: String, default: "9999-12-31 23:59:59" },
|
|
332
|
+
/** 最早年限 */
|
|
333
|
+
minDate: { Type: String, default: "1900-01-01 00:00:00" },
|
|
334
|
+
/** 组件值 */
|
|
335
|
+
modelValue: { type: String, default: "" },
|
|
336
|
+
/** 每月缩写 */
|
|
337
|
+
nameOfMonths: { Type: Object, default: Ae },
|
|
338
|
+
/** 定界符 */
|
|
339
|
+
// periodDelimiter: { Type: String, default: '' },
|
|
340
|
+
/** 显示方式 */
|
|
341
|
+
selectMode: { Type: String, default: "day" },
|
|
342
|
+
/** 存储格式 */
|
|
343
|
+
valueFormat: { Type: String, default: "yyyy-MM-dd" },
|
|
344
|
+
/** 显示格式 */
|
|
345
|
+
displayFormat: { Type: String, default: "yyyy-MM-dd" },
|
|
346
|
+
/** 是否允许日期范围 */
|
|
347
|
+
enablePeriod: { type: Boolean, default: !1 },
|
|
348
|
+
/**
|
|
349
|
+
* 作为内嵌编辑器被创建后默认获得焦点
|
|
350
|
+
*/
|
|
351
|
+
focusOnCreated: { type: Boolean, default: !1 },
|
|
352
|
+
/**
|
|
353
|
+
* 背景文字
|
|
354
|
+
*/
|
|
355
|
+
placeholder: { type: String, default: "请选择日期" },
|
|
356
|
+
/**
|
|
357
|
+
* 作为内嵌编辑器被创建后默认选中文本
|
|
358
|
+
*/
|
|
359
|
+
selectOnCreated: { type: Boolean, default: !1 },
|
|
360
|
+
/**
|
|
361
|
+
* 是否展示时分秒
|
|
362
|
+
*/
|
|
363
|
+
showTime: { type: Boolean, default: !1 },
|
|
364
|
+
/** 显示第二个日期输入框 */
|
|
365
|
+
showEndDate: { type: Boolean, default: !0 },
|
|
366
|
+
/** 显示中间图标 */
|
|
367
|
+
showMiddleIcon: { type: Boolean, default: !0 },
|
|
368
|
+
/** 开始日期 */
|
|
369
|
+
startDateValue: { type: String },
|
|
370
|
+
/** 结束日期 */
|
|
371
|
+
endDateValue: { type: String },
|
|
372
|
+
/** 展示日期范围面板 */
|
|
373
|
+
showPeriod: { type: Boolean, default: !0 },
|
|
374
|
+
/** 启用删除 */
|
|
375
|
+
enableClear: { type: Boolean, default: !0 }
|
|
376
|
+
}, ce = ["日", "一", "二", "三", "四", "五", "六"];
|
|
377
|
+
var q = /* @__PURE__ */ ((e) => (e[e.previous = 1] = "previous", e[e.current = 2] = "current", e[e.next = 3] = "next", e))(q || {});
|
|
378
|
+
const ma = "https://json-schema.org/draft/2020-12/schema", ha = "https://farris-design.gitee.io/date-view.schema.json", ba = "date-view", Ma = "A Farris Input Component", ga = "object", pa = {
|
|
379
|
+
id: {
|
|
380
|
+
description: "The unique identifier for date picker",
|
|
381
|
+
type: "string"
|
|
382
|
+
},
|
|
383
|
+
type: {
|
|
384
|
+
description: "The type string of date picker",
|
|
385
|
+
type: "string",
|
|
386
|
+
default: "date-view"
|
|
387
|
+
},
|
|
388
|
+
appearance: {
|
|
389
|
+
description: "",
|
|
390
|
+
type: "object",
|
|
391
|
+
properties: {
|
|
392
|
+
class: {
|
|
393
|
+
type: "string"
|
|
394
|
+
},
|
|
395
|
+
style: {
|
|
396
|
+
type: "string"
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
default: {}
|
|
400
|
+
},
|
|
401
|
+
disable: {
|
|
402
|
+
type: "string",
|
|
403
|
+
default: !1
|
|
404
|
+
},
|
|
405
|
+
visible: {
|
|
406
|
+
description: "",
|
|
407
|
+
type: "boolean",
|
|
408
|
+
default: !0
|
|
409
|
+
}
|
|
410
|
+
}, ka = [
|
|
411
|
+
"id",
|
|
412
|
+
"type"
|
|
413
|
+
], Pa = {
|
|
414
|
+
$schema: ma,
|
|
415
|
+
$id: ha,
|
|
416
|
+
title: ba,
|
|
417
|
+
description: Ma,
|
|
418
|
+
type: ga,
|
|
419
|
+
properties: pa,
|
|
420
|
+
required: ka
|
|
421
|
+
}, Ta = "date-view", wa = "A Farris Component", Ca = "object", Da = {
|
|
422
|
+
basic: {
|
|
423
|
+
description: "Basic Infomation",
|
|
424
|
+
title: "基本信息",
|
|
425
|
+
properties: {
|
|
426
|
+
id: {
|
|
427
|
+
description: "组件标识",
|
|
428
|
+
title: "标识",
|
|
429
|
+
type: "string",
|
|
430
|
+
readonly: !0
|
|
431
|
+
},
|
|
432
|
+
type: {
|
|
433
|
+
description: "组件类型",
|
|
434
|
+
title: "控件类型",
|
|
435
|
+
type: "select",
|
|
436
|
+
editor: {
|
|
437
|
+
type: "waiting for modification",
|
|
438
|
+
enum: []
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
},
|
|
443
|
+
behavior: {
|
|
444
|
+
description: "Basic Infomation",
|
|
445
|
+
title: "行为",
|
|
446
|
+
properties: {
|
|
447
|
+
visible: {
|
|
448
|
+
description: "",
|
|
449
|
+
title: "可见",
|
|
450
|
+
type: "boolean"
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}, xa = {
|
|
455
|
+
title: Ta,
|
|
456
|
+
description: wa,
|
|
457
|
+
type: Ca,
|
|
458
|
+
categories: Da
|
|
459
|
+
}, We = {
|
|
460
|
+
/** */
|
|
461
|
+
top: { type: Number, default: 0 },
|
|
462
|
+
/** */
|
|
463
|
+
left: { type: Number, default: 0 },
|
|
464
|
+
/** 位置 */
|
|
465
|
+
position: { type: String, default: "bottom" },
|
|
466
|
+
/** 是否允许日期范围 */
|
|
467
|
+
enablePeriod: { type: Boolean, default: !1 },
|
|
468
|
+
dateFormat: { type: String, default: "yyyy-MM-dd" },
|
|
469
|
+
valueFormat: { type: String, default: "yyyy-MM-dd" },
|
|
470
|
+
dates: { type: Array, default: [] },
|
|
471
|
+
daysInWeek: { type: Array, default: ce },
|
|
472
|
+
/** 禁用日期 */
|
|
473
|
+
disableDates: { Type: Array, default: [] },
|
|
474
|
+
/** 禁用范围 */
|
|
475
|
+
disablePeriod: { Type: Array, default: [] },
|
|
476
|
+
/** 自...禁用 */
|
|
477
|
+
disableSince: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
478
|
+
/** 禁用特定日 */
|
|
479
|
+
disableWeekdays: { Type: Array, default: [] },
|
|
480
|
+
/** 禁用周末 */
|
|
481
|
+
disableWeekends: { Type: Boolean, default: !1 },
|
|
482
|
+
/** 到...禁用 */
|
|
483
|
+
disableUntil: { Type: Object, default: { year: 0, month: 0, day: 0 } },
|
|
484
|
+
/** 是否允许键盘定位 */
|
|
485
|
+
enableKeyboadNavigate: { type: Boolean, default: !0 },
|
|
486
|
+
/** 是否启用标记当前 */
|
|
487
|
+
enableMarkCurrent: { type: Boolean, default: !0 },
|
|
488
|
+
/** 每周第一天 */
|
|
489
|
+
firstDayOfTheWeek: { type: String, default: "Sun." },
|
|
490
|
+
/** 高亮日期 */
|
|
491
|
+
highlightDates: { Type: Array, default: [] },
|
|
492
|
+
/** 是否高亮周六 */
|
|
493
|
+
highlightSaturday: { Type: Boolean, default: !1 },
|
|
494
|
+
/** 是否高亮周日 */
|
|
495
|
+
highlightSunday: { Type: Boolean, default: !1 },
|
|
496
|
+
/** 最晚年限 */
|
|
497
|
+
maxYear: { Type: Number, default: 1e4 },
|
|
498
|
+
/** 最早年限 */
|
|
499
|
+
minYear: { Type: Number, default: 1 },
|
|
500
|
+
/** 模式;Embedded;popup; */
|
|
501
|
+
mode: { Type: String, default: "Embedded" },
|
|
502
|
+
/** 月份 */
|
|
503
|
+
months: { type: Array, default: [[]] },
|
|
504
|
+
/** 月份名称 */
|
|
505
|
+
nameOfMonths: { Type: Object, default: Ae },
|
|
506
|
+
/** 二级日期 */
|
|
507
|
+
secondaryDates: { type: Array, default: [] },
|
|
508
|
+
/** 二级月份 */
|
|
509
|
+
secondaryMonths: { type: Array, default: [[]] },
|
|
510
|
+
/** 选择的时间*/
|
|
511
|
+
selectedDate: { type: Object, default: null },
|
|
512
|
+
/** 日期范围组件结束日期 */
|
|
513
|
+
selectedSecondDate: { type: Object, default: null },
|
|
514
|
+
/** 选择的月份 */
|
|
515
|
+
selectedMonth: { type: Object, default: null },
|
|
516
|
+
/** 选择期限 */
|
|
517
|
+
selectedPeriod: { type: Object, default: null },
|
|
518
|
+
/** 选择周 */
|
|
519
|
+
selectedWeek: { type: Object, default: null },
|
|
520
|
+
/** 选择方式 */
|
|
521
|
+
selectMode: { type: String, default: "day" },
|
|
522
|
+
/** 显示第几周 */
|
|
523
|
+
showWeekNumber: { type: Boolean, default: !1 },
|
|
524
|
+
/** 每周标题 */
|
|
525
|
+
weekTitle: { type: String, default: "Week" },
|
|
526
|
+
/** 年份 */
|
|
527
|
+
years: { Type: Array, default: [[]] },
|
|
528
|
+
/** 日期时间值 */
|
|
529
|
+
value: { type: String, default: null },
|
|
530
|
+
/** 是否展示时分秒 */
|
|
531
|
+
showTime: { type: Boolean, default: !1 }
|
|
532
|
+
}, Re = Ie(We, Pa, Ee, $e, xa), Oa = {
|
|
533
|
+
activeMonth: { type: Object, require: !0 },
|
|
534
|
+
ariaLabelPrevMonth: { type: String, default: "" },
|
|
535
|
+
ariaLabelNextMonth: { type: String, default: "" },
|
|
536
|
+
dateFormat: { type: String, default: "yyyy-MM-dd" },
|
|
537
|
+
disablePrePage: { type: Boolean, default: !1 },
|
|
538
|
+
disablePreRecord: { type: Boolean, default: !1 },
|
|
539
|
+
disableNextRecord: { type: Boolean, default: !1 },
|
|
540
|
+
disableNextPage: { type: Boolean, default: !1 },
|
|
541
|
+
years: { type: Array, default: [[{}]] },
|
|
542
|
+
selectingMonth: { type: Boolean, default: !1 },
|
|
543
|
+
selectingYear: { type: Boolean, default: !1 },
|
|
544
|
+
selectMode: { type: String, default: "day" }
|
|
545
|
+
}, Na = /* @__PURE__ */ Z({
|
|
546
|
+
name: "FDatePickerCalendarNavbar",
|
|
547
|
+
props: Oa,
|
|
548
|
+
emits: ["clickMonth", "clickYear", "prePage", "preRecord", "nextRecord", "nextPage"],
|
|
549
|
+
setup(e, a) {
|
|
550
|
+
return () => {
|
|
551
|
+
const n = r(e.ariaLabelPrevMonth), v = r(e.ariaLabelNextMonth), s = r(e.dateFormat), d = r(e.disablePrePage), T = r(e.disablePreRecord), g = r(e.disableNextRecord), f = r(e.disableNextPage), M = r(e.activeMonth), k = r(e.years), l = r(e.selectingMonth), c = r(e.selectingYear), t = r(e.selectMode), i = r(!0), D = r(!0);
|
|
552
|
+
J(() => e.activeMonth, () => {
|
|
553
|
+
var o, N, O, j;
|
|
554
|
+
M.value = {
|
|
555
|
+
month: (o = e.activeMonth) == null ? void 0 : o.month,
|
|
556
|
+
year: (N = e.activeMonth) == null ? void 0 : N.year,
|
|
557
|
+
displayTextOfMonth: (O = e.activeMonth) == null ? void 0 : O.displayTextOfMonth,
|
|
558
|
+
displayTextOfYear: (j = e.activeMonth) == null ? void 0 : j.displayTextOfMonth
|
|
559
|
+
};
|
|
560
|
+
});
|
|
561
|
+
const h = B(() => ({
|
|
562
|
+
"f-datepicker-header": !0,
|
|
563
|
+
monthYearSelBarBorder: l.value || c.value
|
|
564
|
+
})), p = B(() => ({
|
|
565
|
+
"f-datepicker-header-btn": !0,
|
|
566
|
+
"f-datepicker-header-btn-disabled": d.value
|
|
567
|
+
})), b = B(() => !l.value && !c.value), $ = B(() => ({
|
|
568
|
+
"f-datepicker-header-btn": !0,
|
|
569
|
+
"f-datepicker-header-btn-disabled": T.value
|
|
570
|
+
})), I = B(() => ({
|
|
571
|
+
"f-datepicker-header-btn": !0,
|
|
572
|
+
"f-datepicker-header-btn-disabled": g.value
|
|
573
|
+
})), w = B(() => ({
|
|
574
|
+
"f-datepicker-header-btn": !0,
|
|
575
|
+
"f-datepicker-header-btn-disabled": f.value
|
|
576
|
+
})), y = B(() => ({
|
|
577
|
+
"f-datepicker-header-btn": !0,
|
|
578
|
+
"f-datepicker-yearLabel": i.value,
|
|
579
|
+
"f-datepicker-labelBtnNotEdit": !i.value
|
|
580
|
+
})), x = B(() => ({
|
|
581
|
+
"f-datepicker-header-btn": !0,
|
|
582
|
+
"f-datepicker-monthLabel": D.value,
|
|
583
|
+
"f-datepicker-labelBtnNotEdit": !D.value
|
|
584
|
+
})), F = B(() => {
|
|
585
|
+
const o = s.value ? s.value.indexOf("yyyy") : 0, N = s.value ? s.value.indexOf("MM") : 0;
|
|
586
|
+
return o > N ? "MM-yyyy" : "yyyy-MM";
|
|
587
|
+
});
|
|
588
|
+
function W(o) {
|
|
589
|
+
o.stopPropagation(), a.emit("prePage");
|
|
590
|
+
}
|
|
591
|
+
function z(o) {
|
|
592
|
+
o.stopPropagation(), a.emit("preRecord");
|
|
593
|
+
}
|
|
594
|
+
function V(o) {
|
|
595
|
+
o.stopPropagation(), a.emit("clickYear");
|
|
596
|
+
}
|
|
597
|
+
function E(o) {
|
|
598
|
+
o.stopPropagation(), a.emit("clickMonth");
|
|
599
|
+
}
|
|
600
|
+
function _(o) {
|
|
601
|
+
o.stopPropagation(), a.emit("nextRecord");
|
|
602
|
+
}
|
|
603
|
+
function L(o) {
|
|
604
|
+
o.stopPropagation(), a.emit("nextPage");
|
|
605
|
+
}
|
|
606
|
+
function U() {
|
|
607
|
+
return m("button", {
|
|
608
|
+
type: "button",
|
|
609
|
+
class: y.value,
|
|
610
|
+
onClick: (o) => {
|
|
611
|
+
i.value && V(o);
|
|
612
|
+
},
|
|
613
|
+
tabindex: i.value ? "0" : "-1",
|
|
614
|
+
disabled: t.value === "year"
|
|
615
|
+
}, [c.value ? k.value.length > 3 ? k.value[0][1].year + " - " + k.value[3][1].year : "" : M.value.displayTextOfYear]);
|
|
616
|
+
}
|
|
617
|
+
function S() {
|
|
618
|
+
return !c.value && t.value !== "month" && m("button", {
|
|
619
|
+
type: "button",
|
|
620
|
+
class: x.value,
|
|
621
|
+
onClick: (o) => {
|
|
622
|
+
D.value && E(o);
|
|
623
|
+
},
|
|
624
|
+
tabindex: D.value ? "0" : "-1"
|
|
625
|
+
}, [M.value.displayTextOfMonth]);
|
|
626
|
+
}
|
|
627
|
+
return m("div", {
|
|
628
|
+
class: h.value,
|
|
629
|
+
style: "height:40px; overflow:hidden;"
|
|
630
|
+
}, [m("div", {
|
|
631
|
+
class: "f-datepicker-prev-btn"
|
|
632
|
+
}, [m("button", {
|
|
633
|
+
type: "button",
|
|
634
|
+
class: p.value,
|
|
635
|
+
onClick: W
|
|
636
|
+
}, [m("i", {
|
|
637
|
+
class: "f-icon f-icon-arrow-double-60-left"
|
|
638
|
+
}, null)]), b.value && m("button", {
|
|
639
|
+
type: "button",
|
|
640
|
+
"aria-label": n.value,
|
|
641
|
+
class: $.value,
|
|
642
|
+
onClick: z
|
|
643
|
+
}, [m("i", {
|
|
644
|
+
class: "f-icon f-icon-arrow-chevron-left"
|
|
645
|
+
}, null)])]), m("div", {
|
|
646
|
+
class: "f-datepicker-monthYearText"
|
|
647
|
+
}, [F.value === "yyyy-MM" ? [U(), S()] : [S(), U()]]), m("div", {
|
|
648
|
+
class: "f-datepicker-next-btn"
|
|
649
|
+
}, [b.value && m("button", {
|
|
650
|
+
type: "button",
|
|
651
|
+
"aria-label": v.value,
|
|
652
|
+
class: I.value,
|
|
653
|
+
onClick: _
|
|
654
|
+
}, [m("i", {
|
|
655
|
+
class: "f-icon f-icon-arrow-chevron-right"
|
|
656
|
+
}, null)]), m("button", {
|
|
657
|
+
type: "button",
|
|
658
|
+
class: w.value,
|
|
659
|
+
onClick: L
|
|
660
|
+
}, [m("i", {
|
|
661
|
+
class: "f-icon f-icon-arrow-double-60-right"
|
|
662
|
+
}, null)])])]);
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
}), Sa = {
|
|
666
|
+
dates: { Type: Array, default: [] },
|
|
667
|
+
daysInWeek: { Type: Array, default: ce },
|
|
668
|
+
enableKeyboadNavigate: { Type: Boolean, default: !0 },
|
|
669
|
+
enableMarkCurrent: { Type: Boolean, default: !0 },
|
|
670
|
+
enablePeriod: { Type: Boolean, default: !1 },
|
|
671
|
+
firstDayOfTheWeek: { Type: Boolean, default: "Sun." },
|
|
672
|
+
selected: { Type: Object, default: null },
|
|
673
|
+
selectedPeriod: { Type: Object, default: null },
|
|
674
|
+
selectedWeek: { Type: Object, default: null },
|
|
675
|
+
selectMode: { Type: String, default: "day" },
|
|
676
|
+
showWeekNumber: { Type: Boolean, default: !1 },
|
|
677
|
+
weekTitle: { Type: String, default: "Week" }
|
|
678
|
+
};
|
|
679
|
+
var G = /* @__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))(G || {});
|
|
680
|
+
function pe() {
|
|
681
|
+
function e(a) {
|
|
682
|
+
const n = a.key || a.keyCode;
|
|
683
|
+
return n === "Enter" || n === 13 ? 13 : n === "Escape" || n === 27 ? 27 : n === " " || n === 32 ? 32 : n === "ArrowLeft" || n === 37 ? 37 : n === "ArrowUp" || n === 38 ? 38 : n === "ArrowRight" || n === 39 ? 39 : n === "ArrowDown" || n === 40 ? 40 : n === "Tab" || n === 9 ? 9 : n === "Shift" || n === 16 ? 16 : -1;
|
|
684
|
+
}
|
|
685
|
+
return { getKeyCodeFromEvent: e };
|
|
686
|
+
}
|
|
687
|
+
function Ba(e) {
|
|
688
|
+
const a = Object.prototype.toString.call(e);
|
|
689
|
+
return e instanceof Date || typeof e == "object" && a === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || a === "[object Number]" || typeof e == "string" || a === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
|
|
690
|
+
}
|
|
691
|
+
function Ha(e) {
|
|
692
|
+
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
693
|
+
}
|
|
694
|
+
function Ya(e) {
|
|
695
|
+
if (!Ha(e) && typeof e != "number")
|
|
696
|
+
return !1;
|
|
697
|
+
const a = Ba(e);
|
|
698
|
+
return !isNaN(Number(a));
|
|
699
|
+
}
|
|
700
|
+
function ee() {
|
|
701
|
+
function e() {
|
|
702
|
+
return { year: 0, month: 0, day: 0 };
|
|
703
|
+
}
|
|
704
|
+
function a(t) {
|
|
705
|
+
return new Date(
|
|
706
|
+
t.year || 0,
|
|
707
|
+
t.month ? t.month - 1 : 0,
|
|
708
|
+
t.day || 0,
|
|
709
|
+
t.hour ? t.hour : 0,
|
|
710
|
+
t.minute ? t.minute : 0,
|
|
711
|
+
t.second ? t.second : 0,
|
|
712
|
+
0
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
function n(t) {
|
|
716
|
+
const i = /* @__PURE__ */ new Date();
|
|
717
|
+
return t.year || (t.year = i.getFullYear()), t.month || (t.month = i.getMonth() + 1), t.day || (t.day = 1), new Date(
|
|
718
|
+
t.year,
|
|
719
|
+
t.month - 1,
|
|
720
|
+
t.day,
|
|
721
|
+
t.hour ? t.hour : 0,
|
|
722
|
+
t.minute ? t.minute : 0,
|
|
723
|
+
t.second ? t.second : 0,
|
|
724
|
+
0
|
|
725
|
+
);
|
|
726
|
+
}
|
|
727
|
+
function v(t) {
|
|
728
|
+
return new Date(
|
|
729
|
+
t.year || 1,
|
|
730
|
+
(t.month || 1) - 1,
|
|
731
|
+
t.day,
|
|
732
|
+
t.hour ? t.hour : 0,
|
|
733
|
+
t.minute ? t.minute : 0,
|
|
734
|
+
t.second ? t.second : 0,
|
|
735
|
+
0
|
|
736
|
+
).getDay();
|
|
737
|
+
}
|
|
738
|
+
function s(t) {
|
|
739
|
+
return ce.indexOf(t);
|
|
740
|
+
}
|
|
741
|
+
function d(t) {
|
|
742
|
+
return a(t).getTime();
|
|
743
|
+
}
|
|
744
|
+
function T(t) {
|
|
745
|
+
return Math.round(d(t) / 1e3);
|
|
746
|
+
}
|
|
747
|
+
function g(t, i, D) {
|
|
748
|
+
const h = d(i), p = d(D), b = d(t);
|
|
749
|
+
return p - b > b - h ? i : D;
|
|
750
|
+
}
|
|
751
|
+
function f() {
|
|
752
|
+
const t = /* @__PURE__ */ new Date();
|
|
753
|
+
return {
|
|
754
|
+
year: t.getFullYear(),
|
|
755
|
+
month: t.getMonth() + 1,
|
|
756
|
+
day: t.getDate(),
|
|
757
|
+
hour: t.getHours(),
|
|
758
|
+
minute: t.getMinutes(),
|
|
759
|
+
second: t.getSeconds()
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
function M(t, i) {
|
|
763
|
+
const D = i.match(/[^(DdMmYy)]{1,}/g), h = {};
|
|
764
|
+
if (D) {
|
|
765
|
+
let p = D[0];
|
|
766
|
+
D[0] !== D[1] && (p = D[0] + D[1], D[2] && D[1] !== D[2] && (p += D[2]));
|
|
767
|
+
const b = new RegExp("[" + p + "]"), $ = t.split(b), I = i.split(b);
|
|
768
|
+
for (let w = 0; w < I.length; w++)
|
|
769
|
+
I[w].indexOf("yyyy") !== -1 && (h.year = Number($[w])), I[w].indexOf("M") !== -1 && (h.month = Number($[w] || "1")), I[w].indexOf("d") !== -1 && (h.day = Number($[w] || "1"));
|
|
770
|
+
} else {
|
|
771
|
+
const p = (i + "").indexOf("yyyy"), b = (i + "").indexOf("MM"), $ = (i + "").indexOf("dd");
|
|
772
|
+
if (p >= 0) {
|
|
773
|
+
const I = t.substring(p, p + 4);
|
|
774
|
+
h.year = Number(I);
|
|
775
|
+
}
|
|
776
|
+
b >= 0 && (h.month = Number(t.substring(b, b + 2) || "1")), $ >= 0 && (h.day = Number(t.substring($, $ + 2) || "01"));
|
|
777
|
+
}
|
|
778
|
+
return h.year === void 0 && (h.year = f().year), h;
|
|
779
|
+
}
|
|
780
|
+
function k(t, i = !0) {
|
|
781
|
+
const D = new Date(1900, 1, 1, 0, 0, 0), h = new Date(9999, 12, 31, 23, 59, 59), p = i ? D : h;
|
|
782
|
+
let b;
|
|
783
|
+
return t instanceof Date ? b = t : typeof t == "string" ? b = t.trim() ? new Date(t) : p : b = p, Ya(b) || (b = p), {
|
|
784
|
+
year: b.getFullYear(),
|
|
785
|
+
month: b.getMonth() + 1,
|
|
786
|
+
day: b.getDate(),
|
|
787
|
+
hour: b.getHours(),
|
|
788
|
+
minute: b.getMinutes(),
|
|
789
|
+
second: b.getSeconds()
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function l(t) {
|
|
793
|
+
return k(t, !0);
|
|
794
|
+
}
|
|
795
|
+
function c(t) {
|
|
796
|
+
return k(t, !1);
|
|
797
|
+
}
|
|
798
|
+
return {
|
|
799
|
+
emptyDate: e,
|
|
800
|
+
getDate: a,
|
|
801
|
+
getDate2: n,
|
|
802
|
+
getDayNumber: v,
|
|
803
|
+
getEpocTime: T,
|
|
804
|
+
getNearDate: g,
|
|
805
|
+
getWeekdayIndex: s,
|
|
806
|
+
getTimeInMilliseconds: d,
|
|
807
|
+
getToday: f,
|
|
808
|
+
getDateObject: M,
|
|
809
|
+
getMinDate: l,
|
|
810
|
+
getMaxDate: c
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
function re() {
|
|
814
|
+
const { getTimeInMilliseconds: e } = ee();
|
|
815
|
+
function a(l) {
|
|
816
|
+
return l && l.year !== 0 && l.month !== 0 && l.day !== 0;
|
|
817
|
+
}
|
|
818
|
+
function n(l) {
|
|
819
|
+
return l && l.year !== 0 && l.month !== 0;
|
|
820
|
+
}
|
|
821
|
+
function v(l) {
|
|
822
|
+
return l && l.year !== 0;
|
|
823
|
+
}
|
|
824
|
+
function s(l, c) {
|
|
825
|
+
return e(l) < e(c);
|
|
826
|
+
}
|
|
827
|
+
function d(l, c) {
|
|
828
|
+
return e(l) <= e(c);
|
|
829
|
+
}
|
|
830
|
+
function T(l, c) {
|
|
831
|
+
return e(l) === e(c);
|
|
832
|
+
}
|
|
833
|
+
function g(l, c) {
|
|
834
|
+
const t = e(c);
|
|
835
|
+
return e(l.from) === t || e(l.to) === t;
|
|
836
|
+
}
|
|
837
|
+
function f(l, c) {
|
|
838
|
+
return !c || !a(c.to) || !a(c.from) ? !1 : d(c.from, l) && d(l, c.to);
|
|
839
|
+
}
|
|
840
|
+
function M(l, c) {
|
|
841
|
+
return a(c) && e(l) >= e(c);
|
|
842
|
+
}
|
|
843
|
+
function k(l, c) {
|
|
844
|
+
return a(c) && e(l) <= e(c);
|
|
845
|
+
}
|
|
846
|
+
return {
|
|
847
|
+
isDateEarlier: s,
|
|
848
|
+
equal: T,
|
|
849
|
+
inPeriod: f,
|
|
850
|
+
isPoint: g,
|
|
851
|
+
equalOrEarlier: d,
|
|
852
|
+
isInitializedDate: a,
|
|
853
|
+
isInitializedMonth: n,
|
|
854
|
+
isInitializedYear: v,
|
|
855
|
+
isMonthDisabledByDisableSince: M,
|
|
856
|
+
isMonthDisabledByDisableUntil: k
|
|
857
|
+
};
|
|
858
|
+
}
|
|
859
|
+
const Fa = /* @__PURE__ */ Z({
|
|
860
|
+
name: "FDatePickerCalendarView",
|
|
861
|
+
props: Sa,
|
|
862
|
+
emits: ["click", "clickWeek", "keyDown", "mouseEnter", "mouseLeave"],
|
|
863
|
+
setup(e, a) {
|
|
864
|
+
const n = r(e.dates), v = r(e.daysInWeek), s = r(e.enableKeyboadNavigate), d = r(e.enableMarkCurrent), T = r(e.enablePeriod), g = r(e.firstDayOfTheWeek), f = r(e.selected), M = r(e.selectedPeriod), k = r(e.selectedWeek), l = r(e.selectMode), c = r(e.showWeekNumber), t = r(e.weekTitle), i = B(() => c.value && g.value === "Mon");
|
|
865
|
+
J(() => e.dates, () => {
|
|
866
|
+
n.value = e.dates;
|
|
867
|
+
}), J(() => e.selected, () => {
|
|
868
|
+
f.value = e.selected;
|
|
869
|
+
}), J(() => e.enablePeriod, (o, N) => {
|
|
870
|
+
o !== N && (T.value = o);
|
|
871
|
+
});
|
|
872
|
+
const {
|
|
873
|
+
equal: D,
|
|
874
|
+
inPeriod: h,
|
|
875
|
+
isInitializedDate: p,
|
|
876
|
+
equalOrEarlier: b,
|
|
877
|
+
isPoint: $
|
|
878
|
+
} = re(), {
|
|
879
|
+
getKeyCodeFromEvent: I
|
|
880
|
+
} = pe(), w = (o) => {
|
|
881
|
+
const N = !!k.value && o.numberInTheYear === k.value.numberInTheYear && o.year === k.value.year;
|
|
882
|
+
return {
|
|
883
|
+
"f-datepicker-selectWeek": l.value === "week",
|
|
884
|
+
"f-datepicker-selectedWeek": l.value === "week" && N
|
|
885
|
+
};
|
|
886
|
+
}, y = B(() => c.value && g.value === "Mon");
|
|
887
|
+
function x(o) {
|
|
888
|
+
return h(o, M.value);
|
|
889
|
+
}
|
|
890
|
+
function F(o) {
|
|
891
|
+
return !!M.value && $(M.value, o);
|
|
892
|
+
}
|
|
893
|
+
function W(o) {
|
|
894
|
+
return !!f.value && D({
|
|
895
|
+
year: f.value.year,
|
|
896
|
+
month: f.value.month,
|
|
897
|
+
day: f.value.day
|
|
898
|
+
}, {
|
|
899
|
+
year: o.year,
|
|
900
|
+
month: o.month,
|
|
901
|
+
day: o.day
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
const z = (o, N, O) => {
|
|
905
|
+
const j = l.value !== "week" && o.tag === q.current && (T.value && x(o.date) && !F(o.date) || o.range), K = o.tag === q.previous || o.tag === q.next, Q = {
|
|
906
|
+
"f-datepicker-range": j,
|
|
907
|
+
"f-datepicker-no-currmonth": K,
|
|
908
|
+
"f-datepicker-disabled": o.disable,
|
|
909
|
+
"f-datepicker-singledate": !o.disable
|
|
910
|
+
}, R = `d_${N}_${O}`;
|
|
911
|
+
return Q[R] = !0, Q;
|
|
912
|
+
}, V = (o) => {
|
|
913
|
+
const N = l.value !== "week" && o.tag === q.current && (!T.value && W(o.date) || T.value && F(o.date)), O = o.isCurrent && d.value, j = o.highlight && (o.tag === q.previous || o.tag === q.next || o.disable);
|
|
914
|
+
return {
|
|
915
|
+
"f-datepicker-date": !0,
|
|
916
|
+
"f-datepicker-selected": N,
|
|
917
|
+
"f-datepicker-current": O,
|
|
918
|
+
"f-datepicker-opacity": j,
|
|
919
|
+
"f-datepicker-highlight": o.highlight,
|
|
920
|
+
"f-datepicker-disabled": o.disable
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
function E(o, N) {
|
|
924
|
+
N.disable || l.value === "week" || (o.stopPropagation(), a.emit("click", {
|
|
925
|
+
event: o,
|
|
926
|
+
dayItem: N
|
|
927
|
+
}));
|
|
928
|
+
}
|
|
929
|
+
function _(o, N) {
|
|
930
|
+
l.value === "week" && (o.stopPropagation(), a.emit("clickWeek", N));
|
|
931
|
+
}
|
|
932
|
+
function L(o, N) {
|
|
933
|
+
const O = I(o);
|
|
934
|
+
O !== G.tab && (o.preventDefault(), O === G.enter || O === G.space ? E(o, N) : s.value && a.emit("keyDown", N.date));
|
|
935
|
+
}
|
|
936
|
+
function U(o) {
|
|
937
|
+
M.value && p(M.value.from) && !p(M.value.to) && (n.value.forEach((N) => {
|
|
938
|
+
N.days.forEach((O) => {
|
|
939
|
+
O.range = !!M.value && (b(M.value.from, O.date) && b(O.date, o.date) || b(O.date, M.value.from) && b(o.date, O.date));
|
|
940
|
+
});
|
|
941
|
+
}), a.emit("mouseEnter", o.date));
|
|
942
|
+
}
|
|
943
|
+
function S() {
|
|
944
|
+
n.value.forEach((o) => {
|
|
945
|
+
o.days.forEach((N) => {
|
|
946
|
+
N.range = !1;
|
|
947
|
+
});
|
|
948
|
+
}), a.emit("mouseLeave");
|
|
949
|
+
}
|
|
950
|
+
return () => m(Ut, null, [m("div", {
|
|
951
|
+
class: "f-datepicker-table-wrapper"
|
|
952
|
+
}, [m("table", {
|
|
953
|
+
class: "f-datepicker-table",
|
|
954
|
+
cellpadding: "0"
|
|
955
|
+
}, [m("thead", null, [m("tr", null, [i.value && m("th", {
|
|
956
|
+
class: "f-datepicker-weeknbr-title"
|
|
957
|
+
}, [t.value]), v.value && v.value.map((o) => m("th", {
|
|
958
|
+
scope: "col",
|
|
959
|
+
style: "padding-bottom: 8px;padding-top: 4px"
|
|
960
|
+
}, [o]))])]), m("tbody", null, [n.value && n.value.map((o, N) => m("tr", {
|
|
961
|
+
class: w(o),
|
|
962
|
+
onClick: (O) => _(O, o)
|
|
963
|
+
}, [y.value && m("td", {
|
|
964
|
+
class: "f-datepicker-weeknbr"
|
|
965
|
+
}, [m("div", {
|
|
966
|
+
class: "f-datepicker-date"
|
|
967
|
+
}, [o.numberInTheYear])]), o.days && o.days.map((O, j) => m("td", {
|
|
968
|
+
id: `d_${N}_${j}`,
|
|
969
|
+
tabindex: "0",
|
|
970
|
+
class: z(O, N, j),
|
|
971
|
+
onClick: (K) => E(K, O),
|
|
972
|
+
onKeydown: (K) => L(K, O),
|
|
973
|
+
onMouseenter: () => U(O),
|
|
974
|
+
onMouseleave: () => S()
|
|
975
|
+
}, [O.marked && O.marked.marked && m("span", {
|
|
976
|
+
class: "f-datepicker-markdate",
|
|
977
|
+
style: {
|
|
978
|
+
"background-color": O.marked.color
|
|
979
|
+
}
|
|
980
|
+
}, null), m("div", {
|
|
981
|
+
class: V(O)
|
|
982
|
+
}, [O.date.day])]))]))])])])]);
|
|
983
|
+
}
|
|
984
|
+
}), Ia = {
|
|
985
|
+
months: { Type: Array, default: [[]] },
|
|
986
|
+
enableMarkCurrent: { Type: Boolean, default: !1 },
|
|
987
|
+
enableKeyboadNavigate: { Type: Boolean, default: !0 },
|
|
988
|
+
enablePeriod: { Type: Boolean, default: !1 },
|
|
989
|
+
selected: { Type: Object, default: null },
|
|
990
|
+
selectedPeriod: { Type: Object, default: null }
|
|
991
|
+
}, $a = /* @__PURE__ */ Z({
|
|
992
|
+
name: "FDatePickerMonthView",
|
|
993
|
+
props: Ia,
|
|
994
|
+
emits: ["click", "keyDown", "mouseEnter", "mouseLeave"],
|
|
995
|
+
setup(e, a) {
|
|
996
|
+
const n = r(e.months), v = r(e.enableMarkCurrent), s = r(e.enableKeyboadNavigate), d = r(e.enablePeriod), T = r(e.selected), g = r(e.selectedPeriod), {
|
|
997
|
+
equal: f,
|
|
998
|
+
inPeriod: M,
|
|
999
|
+
isInitializedDate: k,
|
|
1000
|
+
equalOrEarlier: l
|
|
1001
|
+
} = re(), {
|
|
1002
|
+
getKeyCodeFromEvent: c
|
|
1003
|
+
} = pe();
|
|
1004
|
+
J(() => e.months, () => {
|
|
1005
|
+
n.value = e.months;
|
|
1006
|
+
}), J(() => e.selected, () => {
|
|
1007
|
+
T.value = e.selected;
|
|
1008
|
+
});
|
|
1009
|
+
function t(w, y) {
|
|
1010
|
+
w.stopPropagation(), !y.disable && a.emit("click", y.date);
|
|
1011
|
+
}
|
|
1012
|
+
function i(w, y) {
|
|
1013
|
+
const x = c(w);
|
|
1014
|
+
x !== G.tab && (w.preventDefault(), x === G.enter || x === G.space ? t(w, y) : s.value && a.emit("keyDown", y));
|
|
1015
|
+
}
|
|
1016
|
+
function D(w) {
|
|
1017
|
+
g.value && k(g.value.from) && !k(g.value.to) && (n.value.forEach((y) => {
|
|
1018
|
+
y.forEach((x) => {
|
|
1019
|
+
x.range = !!g.value && (l(g.value.from, x.date) && l(x.date, w.date) || l(x.date, g.value.from) && l(w.date, x.date));
|
|
1020
|
+
});
|
|
1021
|
+
}), a.emit("mouseEnter", w));
|
|
1022
|
+
}
|
|
1023
|
+
function h() {
|
|
1024
|
+
n.value.forEach((w) => {
|
|
1025
|
+
w.forEach((y) => {
|
|
1026
|
+
y.range = !1;
|
|
1027
|
+
});
|
|
1028
|
+
}), a.emit("mouseLeave");
|
|
1029
|
+
}
|
|
1030
|
+
function p(w) {
|
|
1031
|
+
return !!T.value && f({
|
|
1032
|
+
year: T.value.year,
|
|
1033
|
+
month: T.value.month
|
|
1034
|
+
}, {
|
|
1035
|
+
year: w.year,
|
|
1036
|
+
month: w.month
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
function b(w) {
|
|
1040
|
+
return !!g.value && (f({
|
|
1041
|
+
year: g.value.from.month
|
|
1042
|
+
}, w) || f({
|
|
1043
|
+
year: g.value.to.month
|
|
1044
|
+
}, w));
|
|
1045
|
+
}
|
|
1046
|
+
function $(w) {
|
|
1047
|
+
return M(w, g.value);
|
|
1048
|
+
}
|
|
1049
|
+
const I = (w) => ({
|
|
1050
|
+
"f-datepicker-month-cell": !0,
|
|
1051
|
+
"f-datepicker-current": w.isCurrent && v.value,
|
|
1052
|
+
"f-datepicker-selected": !d.value && p(w.date) || d.value && b(w.date),
|
|
1053
|
+
"f-datepicker-disabled": w.disable,
|
|
1054
|
+
"f-datepicker-range": $(w.date) || w.range
|
|
1055
|
+
});
|
|
1056
|
+
return () => m("div", {
|
|
1057
|
+
class: "f-datepicker-table-wrapper"
|
|
1058
|
+
}, [m("table", {
|
|
1059
|
+
class: "f-datepicker-table"
|
|
1060
|
+
}, [m("tbody", null, [n.value && n.value.map((w, y) => m("tr", null, [w.map((x, F) => m("td", {
|
|
1061
|
+
id: `m_${y}_${F}`,
|
|
1062
|
+
class: `m_${y}_${F}`,
|
|
1063
|
+
onClick: (W) => t(W, x),
|
|
1064
|
+
onKeydown: (W) => i(W, x),
|
|
1065
|
+
onMouseenter: () => D(x),
|
|
1066
|
+
onMouseleave: () => h(),
|
|
1067
|
+
tabindex: "0",
|
|
1068
|
+
style: "width: 33.3%"
|
|
1069
|
+
}, [m("div", {
|
|
1070
|
+
class: "f-datepicker-month"
|
|
1071
|
+
}, [m("span", {
|
|
1072
|
+
class: I(x)
|
|
1073
|
+
}, [x.displayText])])]))]))])])]);
|
|
1074
|
+
}
|
|
1075
|
+
}), Ea = {
|
|
1076
|
+
years: { Type: Array, default: [[]] },
|
|
1077
|
+
enableKeyboadNavigate: { Type: Boolean, default: !0 },
|
|
1078
|
+
enableMarkCurrent: { Type: Boolean, default: !0 },
|
|
1079
|
+
enablePeriod: { Type: Boolean, default: !1 },
|
|
1080
|
+
selected: { Type: Object, default: null },
|
|
1081
|
+
selectedPeriod: { Type: Object, default: null }
|
|
1082
|
+
}, ja = /* @__PURE__ */ Z({
|
|
1083
|
+
name: "FDatePickerYearView",
|
|
1084
|
+
props: Ea,
|
|
1085
|
+
emits: ["click", "keyDown", "mouseEnter", "mouseLeave"],
|
|
1086
|
+
setup(e, a) {
|
|
1087
|
+
const n = r(e.years), v = r(e.enableMarkCurrent), s = r(e.enableKeyboadNavigate), d = r(e.enablePeriod), T = r(e.selected), g = r(e.selectedPeriod), {
|
|
1088
|
+
equal: f,
|
|
1089
|
+
inPeriod: M,
|
|
1090
|
+
isInitializedDate: k,
|
|
1091
|
+
equalOrEarlier: l
|
|
1092
|
+
} = re(), {
|
|
1093
|
+
getKeyCodeFromEvent: c
|
|
1094
|
+
} = pe();
|
|
1095
|
+
J(() => e.years, () => {
|
|
1096
|
+
n.value = e.years;
|
|
1097
|
+
}), J(() => e.selected, () => {
|
|
1098
|
+
T.value = e.selected;
|
|
1099
|
+
});
|
|
1100
|
+
const t = (y, x) => {
|
|
1101
|
+
const F = `y_${y}_${x}`, W = {
|
|
1102
|
+
"f-datepicker-no-currmonth": y === 0 && x === 0 || y === 3 && x === 2
|
|
1103
|
+
};
|
|
1104
|
+
return W[F] = !0, W;
|
|
1105
|
+
};
|
|
1106
|
+
function i(y) {
|
|
1107
|
+
return M(y, g.value);
|
|
1108
|
+
}
|
|
1109
|
+
function D(y) {
|
|
1110
|
+
return !!T.value && f({
|
|
1111
|
+
year: T.value.year
|
|
1112
|
+
}, y);
|
|
1113
|
+
}
|
|
1114
|
+
function h(y) {
|
|
1115
|
+
return !!g.value && (f({
|
|
1116
|
+
year: g.value.from.year
|
|
1117
|
+
}, y) || f({
|
|
1118
|
+
year: g.value.to.year
|
|
1119
|
+
}, y));
|
|
1120
|
+
}
|
|
1121
|
+
const p = (y) => ({
|
|
1122
|
+
"f-datepicker-year-cell": !0,
|
|
1123
|
+
"f-datepicker-current": y.isCurrent && v.value,
|
|
1124
|
+
"f-datepicker-selected": !g.value && D(y.date) || d.value && h(y.date),
|
|
1125
|
+
"f-datepicker-disabled": y.disable,
|
|
1126
|
+
"f-datepicker-range": i(y.date) || y.range
|
|
1127
|
+
});
|
|
1128
|
+
function b(y, x) {
|
|
1129
|
+
y.stopPropagation(), !x.disable && a.emit("click", x);
|
|
1130
|
+
}
|
|
1131
|
+
function $(y, x) {
|
|
1132
|
+
const F = c(y);
|
|
1133
|
+
F !== G.tab && (y.preventDefault(), F === G.enter || F === G.space ? b(y, x) : s.value && a.emit("keyDown", x));
|
|
1134
|
+
}
|
|
1135
|
+
function I(y) {
|
|
1136
|
+
g.value && k(g.value.from) && !k(g.value.to) && (n.value.forEach((x) => {
|
|
1137
|
+
x.forEach((F) => {
|
|
1138
|
+
F.range = !!g.value && (l(g.value.from, F.date) && l(F.date, y.date) || l(F.date, g.value.from) && l(y.date, F.date));
|
|
1139
|
+
});
|
|
1140
|
+
}), a.emit("mouseEnter", y));
|
|
1141
|
+
}
|
|
1142
|
+
function w() {
|
|
1143
|
+
n.value.forEach((y) => {
|
|
1144
|
+
y.forEach((x) => {
|
|
1145
|
+
x.range = !1;
|
|
1146
|
+
});
|
|
1147
|
+
}), a.emit("mouseLeave");
|
|
1148
|
+
}
|
|
1149
|
+
return () => m("table", {
|
|
1150
|
+
class: "f-datepicker-table-wrapper"
|
|
1151
|
+
}, [m("tbody", {
|
|
1152
|
+
class: "f-datepicker-table"
|
|
1153
|
+
}, [n.value && n.value.map((y, x) => m("tr", null, [y.map((F, W) => m("td", {
|
|
1154
|
+
id: "y_{yi}_{i}",
|
|
1155
|
+
class: t(x, W),
|
|
1156
|
+
onClick: (z) => b(z, F),
|
|
1157
|
+
onKeydown: (z) => $(z, F),
|
|
1158
|
+
onMouseenter: () => I(F),
|
|
1159
|
+
onMouseleave: () => w(),
|
|
1160
|
+
tabindex: "0"
|
|
1161
|
+
}, [m("div", {
|
|
1162
|
+
class: "f-datepicker-year"
|
|
1163
|
+
}, [m("span", {
|
|
1164
|
+
class: p(F)
|
|
1165
|
+
}, [F.year])])]))]))])]);
|
|
1166
|
+
}
|
|
1167
|
+
});
|
|
1168
|
+
function ke() {
|
|
1169
|
+
function e(s) {
|
|
1170
|
+
return new Date(
|
|
1171
|
+
s.year || 0,
|
|
1172
|
+
(s.month || 1) - 1,
|
|
1173
|
+
s.day,
|
|
1174
|
+
s.hour ? s.hour : 0,
|
|
1175
|
+
s.minute ? s.minute : 0,
|
|
1176
|
+
s.second ? s.second : 0,
|
|
1177
|
+
0
|
|
1178
|
+
).getDay();
|
|
1179
|
+
}
|
|
1180
|
+
function a(s) {
|
|
1181
|
+
if (!s)
|
|
1182
|
+
return 1;
|
|
1183
|
+
if (!/^\d+$/.test(s.value))
|
|
1184
|
+
return -1;
|
|
1185
|
+
let d = Number(s.value);
|
|
1186
|
+
return (s.format.length === 1 && s.value.length !== 1 && d < 10 || s.format.length === 1 && s.value.length !== 2 && d >= 10 || s.format.length === 2 && s.value.length > 2) && (d = -1), d;
|
|
1187
|
+
}
|
|
1188
|
+
function n(s, d) {
|
|
1189
|
+
if (s.value) {
|
|
1190
|
+
for (let T = 1; T <= 12; T++)
|
|
1191
|
+
if (s.value.toLowerCase() === d[T].toLowerCase())
|
|
1192
|
+
return T;
|
|
1193
|
+
}
|
|
1194
|
+
return -1;
|
|
1195
|
+
}
|
|
1196
|
+
function v(s) {
|
|
1197
|
+
const d = new Date(s.year || 0, (s.month || 1) - 1, s.day, 0, 0, 0, 0);
|
|
1198
|
+
return d.setDate(d.getDate() + (d.getDay() === 0 ? -3 : 4 - d.getDay())), Math.round((d.getTime() - new Date(d.getFullYear(), 0, 4).getTime()) / 864e5 / 7) + 1;
|
|
1199
|
+
}
|
|
1200
|
+
return { getNumberByValue: a, getDayNumber: e, getMonthNumberByMonthName: n, getWeekNumber: v };
|
|
1201
|
+
}
|
|
1202
|
+
function Aa(e, a, n, v, s, d, T, g) {
|
|
1203
|
+
const { getTimeInMilliseconds: f, getWeekdayIndex: M } = ee(), { isInitializedDate: k } = re(), { getDayNumber: l } = ke();
|
|
1204
|
+
function c(t) {
|
|
1205
|
+
if (t.year && t.year < e || t.year && t.year > a)
|
|
1206
|
+
return !0;
|
|
1207
|
+
const i = f(t), D = t.hour !== void 0;
|
|
1208
|
+
if (k(v) && (D ? i : i + 24 * 60 * 60 * 1e3 - 1) < f(v) || k(n) && i > f(n))
|
|
1209
|
+
return !0;
|
|
1210
|
+
if (T) {
|
|
1211
|
+
const p = l(t);
|
|
1212
|
+
if (p === 0 || p === 6)
|
|
1213
|
+
return !0;
|
|
1214
|
+
}
|
|
1215
|
+
const h = l(t);
|
|
1216
|
+
return !!(g.length > 0 && g.find((b) => M(b) === h) || s.length > 0 && s.find((b) => (b.year === 0 || b.year === t.year) && (b.month === 0 || b.month === t.month) && b.day === t.day) || d.length > 0 && d.find((b) => k(b.from) && k(b.to) && i >= f(b.from) && i <= f(b.to)));
|
|
1217
|
+
}
|
|
1218
|
+
return { isDisabledDate: c };
|
|
1219
|
+
}
|
|
1220
|
+
function Wa() {
|
|
1221
|
+
const { getDayNumber: e } = ke();
|
|
1222
|
+
function a(v, s, d) {
|
|
1223
|
+
let T = [];
|
|
1224
|
+
T = s.reduce((f, M) => {
|
|
1225
|
+
const k = M.dates.map((l) => ({ date: l, color: M.color }));
|
|
1226
|
+
return [...f, ...k];
|
|
1227
|
+
}, T);
|
|
1228
|
+
const g = T.find((f) => (f.date.year === 0 || f.date.year === v.year) && (f.date.month === 0 || f.date.month === v.month) && f.date.day === v.day);
|
|
1229
|
+
if (g)
|
|
1230
|
+
return { marked: !0, color: g.color };
|
|
1231
|
+
if (d && d.marked) {
|
|
1232
|
+
const f = e(v);
|
|
1233
|
+
if (f === 0 || f === 6)
|
|
1234
|
+
return { marked: !0, color: d.color };
|
|
1235
|
+
}
|
|
1236
|
+
return { marked: !1, color: "" };
|
|
1237
|
+
}
|
|
1238
|
+
function n(v, s, d, T) {
|
|
1239
|
+
const g = e(v);
|
|
1240
|
+
return s && g === 0 || d && g === 6 ? !0 : !!T.find((M) => (M.year === 0 || M.year === v.year) && (M.month === 0 || M.month === v.month) && M.day === v.day);
|
|
1241
|
+
}
|
|
1242
|
+
return { isHighlightedDate: n, isMarkedDate: a };
|
|
1243
|
+
}
|
|
1244
|
+
function Ve() {
|
|
1245
|
+
const { getTimeInMilliseconds: e } = ee(), { isInitializedDate: a } = re();
|
|
1246
|
+
function n(s, d) {
|
|
1247
|
+
return a(d) && e(s) < e(d);
|
|
1248
|
+
}
|
|
1249
|
+
function v(s, d) {
|
|
1250
|
+
return a(d) && e(s) > e(d);
|
|
1251
|
+
}
|
|
1252
|
+
return { isMonthDisabledByDisableSince: v, isMonthDisabledByDisableUntil: n };
|
|
1253
|
+
}
|
|
1254
|
+
function Le() {
|
|
1255
|
+
const { getToday: e } = ee(), { isMonthDisabledByDisableSince: a, isMonthDisabledByDisableUntil: n } = Ve();
|
|
1256
|
+
function v(k) {
|
|
1257
|
+
const l = { displayTextOfMonth: "", month: 0, year: 0, displayTextOfYear: "" };
|
|
1258
|
+
if (k) {
|
|
1259
|
+
const c = k.match(/[^0-9]/), t = c && c.length ? c[0] : "", i = k.split(t);
|
|
1260
|
+
l.month = i[0].length === 2 ? Number(i[0]) : Number(i[1]), l.year = i[0].length === 2 ? Number(i[1]) : Number(i[0]);
|
|
1261
|
+
}
|
|
1262
|
+
return l;
|
|
1263
|
+
}
|
|
1264
|
+
function s(k, l) {
|
|
1265
|
+
return new Date(l, k, 0).getDate();
|
|
1266
|
+
}
|
|
1267
|
+
function d(k, l, c) {
|
|
1268
|
+
return new Date(k, l - 1, c, 0, 0, 0, 0);
|
|
1269
|
+
}
|
|
1270
|
+
function T(k, l) {
|
|
1271
|
+
const c = d(l, k, 1);
|
|
1272
|
+
return c.setMonth(c.getMonth() - 1), s(c.getMonth() + 1, c.getFullYear());
|
|
1273
|
+
}
|
|
1274
|
+
function g(k, l, c, t) {
|
|
1275
|
+
const i = e(), D = [], { year: h } = l, p = 3, b = { year: c.year, month: c.month, day: c.day }, $ = { year: t.year, month: t.month, day: t.day };
|
|
1276
|
+
for (let I = 1; I <= 12; I += p) {
|
|
1277
|
+
const w = [];
|
|
1278
|
+
for (let y = I; y < I + p; y++) {
|
|
1279
|
+
const x = a({ year: h, month: y, day: 1 }, b) || n({ year: h, month: y, day: s(y, h || 0) }, $);
|
|
1280
|
+
w.push({
|
|
1281
|
+
month: y,
|
|
1282
|
+
displayText: k[y],
|
|
1283
|
+
isCurrent: y === i.month && h === i.year,
|
|
1284
|
+
disable: x,
|
|
1285
|
+
date: { year: h, month: y }
|
|
1286
|
+
});
|
|
1287
|
+
}
|
|
1288
|
+
D.push(w);
|
|
1289
|
+
}
|
|
1290
|
+
return D;
|
|
1291
|
+
}
|
|
1292
|
+
function f(k, l) {
|
|
1293
|
+
const c = {
|
|
1294
|
+
year: k === 12 ? l + 1 : l
|
|
1295
|
+
}, t = k === 12 ? 1 : k + 1;
|
|
1296
|
+
return c.month = t, c;
|
|
1297
|
+
}
|
|
1298
|
+
function M(k, l) {
|
|
1299
|
+
const c = {
|
|
1300
|
+
year: k === 1 ? l - 1 : l
|
|
1301
|
+
}, t = k === 1 ? 12 : k - 1;
|
|
1302
|
+
return c.month = t, c;
|
|
1303
|
+
}
|
|
1304
|
+
return { daysInMonth: s, daysInPreMonth: T, generateMonths: g, parseDefaultMonth: v, getNextMonth: f, getPreviousMonth: M };
|
|
1305
|
+
}
|
|
1306
|
+
function Ra({ isDisabledDate: e }) {
|
|
1307
|
+
const { getToday: a } = ee(), { daysInMonth: n, daysInPreMonth: v, getNextMonth: s, getPreviousMonth: d } = Le(), { isHighlightedDate: T, isMarkedDate: g } = Wa(), { getWeekNumber: f } = ke();
|
|
1308
|
+
function M(t) {
|
|
1309
|
+
const i = ce.indexOf(t);
|
|
1310
|
+
return i > 0 ? 7 - i : 0;
|
|
1311
|
+
}
|
|
1312
|
+
function k(t, i, D) {
|
|
1313
|
+
const h = /* @__PURE__ */ new Date();
|
|
1314
|
+
h.setDate(1), h.setMonth(i - 1), h.setFullYear(t);
|
|
1315
|
+
const p = h.getDay() + D;
|
|
1316
|
+
return p >= 7 ? p - 7 : p;
|
|
1317
|
+
}
|
|
1318
|
+
function l(t, i, D, h, p) {
|
|
1319
|
+
return t === p.day && i === p.month && D === p.year && h === q.current;
|
|
1320
|
+
}
|
|
1321
|
+
function c(t, i, D, h, p, b, $, I, w) {
|
|
1322
|
+
const y = [], x = a(), F = k(i, t, M(D)), W = n(t, i), z = v(t, i);
|
|
1323
|
+
let V = 1, E = q.previous;
|
|
1324
|
+
for (let _ = 1; _ < 7; _++) {
|
|
1325
|
+
const L = [];
|
|
1326
|
+
if (_ === 1) {
|
|
1327
|
+
const S = z - F + 1;
|
|
1328
|
+
for (let N = S; N <= z; N++) {
|
|
1329
|
+
const O = {
|
|
1330
|
+
year: t === 1 ? i - 1 : i,
|
|
1331
|
+
month: t === 1 ? 12 : t - 1,
|
|
1332
|
+
day: N
|
|
1333
|
+
}, j = l(N, t, i, E, x), K = e(O), Q = g(O, h, p), R = T(O, I, $, b);
|
|
1334
|
+
L.push({ date: O, tag: E, isCurrent: j, disable: K, marked: Q, highlight: R });
|
|
1335
|
+
}
|
|
1336
|
+
E = q.current;
|
|
1337
|
+
const o = 7 - L.length;
|
|
1338
|
+
for (let N = 0; N < o; N++) {
|
|
1339
|
+
const O = { year: i, month: t, day: V }, j = l(V, t, i, E, x), K = e(O), Q = g(O, h, p), R = T(O, I, $, b);
|
|
1340
|
+
L.push({ date: O, tag: E, isCurrent: j, disable: K, marked: Q, highlight: R }), V++;
|
|
1341
|
+
}
|
|
1342
|
+
} else
|
|
1343
|
+
for (let S = 1; S <= 7; S++) {
|
|
1344
|
+
V > W && (V = 1, E = q.next);
|
|
1345
|
+
const o = {
|
|
1346
|
+
year: E === q.next && t === 12 ? i + 1 : i,
|
|
1347
|
+
month: E === q.current ? t : E === q.next && t < 12 ? t + 1 : 1,
|
|
1348
|
+
day: V
|
|
1349
|
+
}, N = l(V, t, i, E, x), O = e(o), j = g(o, h, p), K = T(o, I, $, b);
|
|
1350
|
+
L.push({ date: o, tag: E, isCurrent: N, disable: O, marked: j, highlight: K }), V++;
|
|
1351
|
+
}
|
|
1352
|
+
const U = w && D === "Mon." ? f(L[0].date) : 0;
|
|
1353
|
+
y.push({ days: L, numberInTheYear: U, year: i });
|
|
1354
|
+
}
|
|
1355
|
+
return y;
|
|
1356
|
+
}
|
|
1357
|
+
return { generateCalendar: c };
|
|
1358
|
+
}
|
|
1359
|
+
function Va() {
|
|
1360
|
+
const { getToday: e } = ee();
|
|
1361
|
+
function a(n, v, s, d, T, g) {
|
|
1362
|
+
const f = [], M = n - n % 10, { year: k, month: l } = v, c = e(), t = 3, i = M + 10;
|
|
1363
|
+
for (let D = M - 1; D < i; D += t) {
|
|
1364
|
+
const h = [];
|
|
1365
|
+
for (let p = D; p < D + t; p++) {
|
|
1366
|
+
const b = p < s || p > d;
|
|
1367
|
+
h.push({
|
|
1368
|
+
year: p,
|
|
1369
|
+
isCurrent: p === c.year,
|
|
1370
|
+
selected: p === k,
|
|
1371
|
+
disable: b,
|
|
1372
|
+
date: { year: p }
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
f.push(h);
|
|
1376
|
+
}
|
|
1377
|
+
return f;
|
|
1378
|
+
}
|
|
1379
|
+
return { generateYears: a };
|
|
1380
|
+
}
|
|
1381
|
+
const La = /* @__PURE__ */ Z({
|
|
1382
|
+
name: "FDateView",
|
|
1383
|
+
props: We,
|
|
1384
|
+
emits: ["datePicked", "confirm"],
|
|
1385
|
+
setup(e, a) {
|
|
1386
|
+
const n = r(), v = r(""), s = r(e.mode), d = r(e.top), T = r(e.left), g = r(e.position), f = r(e.enablePeriod), M = r(e.selectMode), k = r(e.dateFormat), l = r(e.nameOfMonths), c = r(e.valueFormat), t = r([]), i = r(!1), D = r(""), h = r(!1), p = r(""), b = r(), $ = r(!1), I = r(!1), w = r(!1), y = r(!1), x = r(!1), F = r(!1), W = r(!1), z = r(!1);
|
|
1387
|
+
r(e.secondaryDates);
|
|
1388
|
+
const V = r(e.daysInWeek), E = r(e.enableKeyboadNavigate), _ = r(e.enableMarkCurrent), L = r(e.firstDayOfTheWeek), U = r(e.showWeekNumber), S = r(e.selectedDate), o = r(e.selectedSecondDate), N = r(e.value), O = r(e.selectedWeek), j = r(e.selectedPeriod), K = r(e.weekTitle), Q = r(e.secondaryMonths), R = r(e.selectedMonth), ye = r(e.minYear), fe = r(e.maxYear), te = r(e.disableSince), ae = r(e.disableUntil), Ke = r(e.disableDates), _e = r(e.disablePeriod), qe = r(e.disableWeekdays), ze = r(e.disableWeekends), Pe = Aa(ye.value, fe.value, te.value, ae.value, Ke.value, _e.value, ze.value, qe.value), {
|
|
1389
|
+
formatTo: Te,
|
|
1390
|
+
parseToDate: we
|
|
1391
|
+
} = Vt(), {
|
|
1392
|
+
isMonthDisabledByDisableSince: Ue,
|
|
1393
|
+
isMonthDisabledByDisableUntil: Ge
|
|
1394
|
+
} = Ve(), {
|
|
1395
|
+
generateCalendar: Ce
|
|
1396
|
+
} = Ra(Pe), {
|
|
1397
|
+
getToday: Xe,
|
|
1398
|
+
getDateObject: Je
|
|
1399
|
+
} = ee(), {
|
|
1400
|
+
generateMonths: Qe,
|
|
1401
|
+
getNextMonth: Ze,
|
|
1402
|
+
getPreviousMonth: et,
|
|
1403
|
+
daysInMonth: tt
|
|
1404
|
+
} = Le(), {
|
|
1405
|
+
generateYears: at
|
|
1406
|
+
} = Va(), H = Xe(), X = B(() => {
|
|
1407
|
+
const u = oe(H), C = N.value && we(N.value, c.value);
|
|
1408
|
+
return C ? Je(Te(C, "yyyy-MM-dd"), "yyyy-MM-dd") : u;
|
|
1409
|
+
});
|
|
1410
|
+
S.value = X.value;
|
|
1411
|
+
const Y = r({
|
|
1412
|
+
year: X.value.year || 1,
|
|
1413
|
+
month: X.value.month || 1,
|
|
1414
|
+
displayTextOfMonth: l.value[X.value.month || "1"],
|
|
1415
|
+
displayTextOfYear: `${X.value.year}`
|
|
1416
|
+
});
|
|
1417
|
+
R.value = {
|
|
1418
|
+
year: X.value.year ? X.value.year : void 0,
|
|
1419
|
+
month: X.value.month ? X.value.month : void 0
|
|
1420
|
+
};
|
|
1421
|
+
const De = H.month === 12 ? (H.year || 1) + 1 : H.year, nt = (H.month || 1) < 12 ? (H.month || 1) + 1 : 1, ve = r({
|
|
1422
|
+
year: De,
|
|
1423
|
+
month: nt,
|
|
1424
|
+
displayTextOfMonth: l.value[H.month || "1"],
|
|
1425
|
+
displayTextOfYear: `${De}`
|
|
1426
|
+
}), ot = B(() => Ce(Y.value.month, Y.value.year, L.value, [], {
|
|
1427
|
+
marked: !0,
|
|
1428
|
+
color: ""
|
|
1429
|
+
}, e.highlightDates, e.highlightSaturday, e.highlightSunday, U.value)), lt = B(() => Ce(ve.value.month, ve.value.year, L.value, [], {
|
|
1430
|
+
marked: !0,
|
|
1431
|
+
color: ""
|
|
1432
|
+
}, e.highlightDates, e.highlightSaturday, e.highlightSunday, U.value)), rt = B(() => Qe(l.value, {
|
|
1433
|
+
year: Y.value.year,
|
|
1434
|
+
month: Y.value.month
|
|
1435
|
+
}, te.value, ae.value)), me = B(() => at(Y.value.year, {
|
|
1436
|
+
year: Y.value.year,
|
|
1437
|
+
month: Y.value.month
|
|
1438
|
+
}, ye.value, fe.value, te.value, ae.value)), st = B(() => {
|
|
1439
|
+
const u = {
|
|
1440
|
+
"f-datepicker-container": !0
|
|
1441
|
+
}, C = `container-position-${g.value}`;
|
|
1442
|
+
return u[C] = !0, u;
|
|
1443
|
+
});
|
|
1444
|
+
J(() => e.enablePeriod, (u, C) => {
|
|
1445
|
+
u !== C && (f.value = u);
|
|
1446
|
+
});
|
|
1447
|
+
function it() {
|
|
1448
|
+
return f.value ? "" : e.showTime ? "487px" : "287px";
|
|
1449
|
+
}
|
|
1450
|
+
const ut = B(() => ({
|
|
1451
|
+
top: `${d.value}px`,
|
|
1452
|
+
left: `${T.value}px`,
|
|
1453
|
+
width: it(),
|
|
1454
|
+
// 'position': displayMode.value === 'Embedded' ? 'relative' : 'absolute',
|
|
1455
|
+
position: "relative",
|
|
1456
|
+
"z-index": s.value === "Embedded" ? 0 : 9999,
|
|
1457
|
+
"margin-top": "0px"
|
|
1458
|
+
}));
|
|
1459
|
+
function _a(u) {
|
|
1460
|
+
}
|
|
1461
|
+
function dt(u) {
|
|
1462
|
+
u.stopPropagation();
|
|
1463
|
+
}
|
|
1464
|
+
function ct(u, C) {
|
|
1465
|
+
const P = Y.value.year - (h.value ? 10 : 1), A = {
|
|
1466
|
+
year: P,
|
|
1467
|
+
month: Y.value.month,
|
|
1468
|
+
displayTextOfMonth: l.value[Y.value.month || "1"],
|
|
1469
|
+
displayTextOfYear: `${P}`
|
|
1470
|
+
};
|
|
1471
|
+
Y.value = A;
|
|
1472
|
+
}
|
|
1473
|
+
function he(u, C) {
|
|
1474
|
+
const P = et(Y.value.month, Y.value.year), A = {
|
|
1475
|
+
year: P.year || 1,
|
|
1476
|
+
month: P.month || 1,
|
|
1477
|
+
displayTextOfMonth: l.value[P.month || "1"],
|
|
1478
|
+
displayTextOfYear: `${P.year}`
|
|
1479
|
+
};
|
|
1480
|
+
Y.value = A;
|
|
1481
|
+
}
|
|
1482
|
+
function be(u, C) {
|
|
1483
|
+
const P = Ze(Y.value.month, Y.value.year), A = {
|
|
1484
|
+
year: P.year || 1,
|
|
1485
|
+
month: P.month || 1,
|
|
1486
|
+
displayTextOfMonth: l.value[P.month || "1"],
|
|
1487
|
+
displayTextOfYear: `${P.year}`
|
|
1488
|
+
};
|
|
1489
|
+
Y.value = A;
|
|
1490
|
+
}
|
|
1491
|
+
function yt(u, C) {
|
|
1492
|
+
let P = Y.value.year + 1;
|
|
1493
|
+
h.value && (P = me.value[3][0].year + 2);
|
|
1494
|
+
const A = {
|
|
1495
|
+
year: P,
|
|
1496
|
+
month: Y.value.month,
|
|
1497
|
+
displayTextOfMonth: l.value[Y.value.month || "1"],
|
|
1498
|
+
displayTextOfYear: `${P}`
|
|
1499
|
+
};
|
|
1500
|
+
Y.value = A;
|
|
1501
|
+
}
|
|
1502
|
+
function ft(u) {
|
|
1503
|
+
i.value = !i.value, h.value = !1;
|
|
1504
|
+
}
|
|
1505
|
+
function vt(u) {
|
|
1506
|
+
i.value = M.value === "month" ? !i.value : !1, h.value = M.value === "year" ? !0 : !h.value;
|
|
1507
|
+
}
|
|
1508
|
+
const mt = B(() => ({
|
|
1509
|
+
"active-month": Y.value,
|
|
1510
|
+
"date-format": k.value,
|
|
1511
|
+
"disable-pre-page": $.value,
|
|
1512
|
+
"disable-pre-record": I.value,
|
|
1513
|
+
"disable-next-record": w.value,
|
|
1514
|
+
"disable-next-page": y.value,
|
|
1515
|
+
years: me.value,
|
|
1516
|
+
"selecting-month": i.value,
|
|
1517
|
+
"selecting-year": h.value,
|
|
1518
|
+
"select-mode": M.value
|
|
1519
|
+
})), ht = B(() => ({
|
|
1520
|
+
"active-month": ve.value,
|
|
1521
|
+
"date-format": k.value,
|
|
1522
|
+
"disable-pre-page": x.value,
|
|
1523
|
+
"disable-pre-record": F.value,
|
|
1524
|
+
"disable-next-record": W.value,
|
|
1525
|
+
"disable-next-page": z.value,
|
|
1526
|
+
years: t.value,
|
|
1527
|
+
"selecting-month": D.value,
|
|
1528
|
+
"selecting-year": p.value,
|
|
1529
|
+
"select-mode": M.value
|
|
1530
|
+
}));
|
|
1531
|
+
function xe(u, C) {
|
|
1532
|
+
return m(Na, ue(C, {
|
|
1533
|
+
onPrePage: (P) => ct(),
|
|
1534
|
+
onPreRecord: (P) => he(),
|
|
1535
|
+
onNextRecord: (P) => be(),
|
|
1536
|
+
onNextPage: (P) => yt(),
|
|
1537
|
+
onClickMonth: (P) => ft(),
|
|
1538
|
+
onClickYear: (P) => vt()
|
|
1539
|
+
}), null);
|
|
1540
|
+
}
|
|
1541
|
+
const se = B(() => !i.value && !h.value && !b.value || f.value && M.value !== "week" && !D.value && !p.value && !b.value), bt = B(() => i.value && !h.value), Mt = B(() => h.value && !i.value);
|
|
1542
|
+
Gt(() => {
|
|
1543
|
+
se.value && (Y.value = {
|
|
1544
|
+
year: R.value.year || 1,
|
|
1545
|
+
month: R.value.month || 1,
|
|
1546
|
+
displayTextOfMonth: l.value[R.value.month || "1"],
|
|
1547
|
+
displayTextOfYear: `${R.value.year}`
|
|
1548
|
+
});
|
|
1549
|
+
});
|
|
1550
|
+
const gt = B(() => ({
|
|
1551
|
+
dates: ot.value,
|
|
1552
|
+
daysInWeek: V.value,
|
|
1553
|
+
enableKeyboadNavigate: E.value,
|
|
1554
|
+
enableMarkCurrent: _.value,
|
|
1555
|
+
enablePeriod: f.value,
|
|
1556
|
+
firstDayOfTheWeek: L.value,
|
|
1557
|
+
selected: S.value,
|
|
1558
|
+
selectedPeriod: j.value,
|
|
1559
|
+
selectedWeek: O.value,
|
|
1560
|
+
selectMode: M.value,
|
|
1561
|
+
showWeekNumber: U.value,
|
|
1562
|
+
weekTitle: K.value
|
|
1563
|
+
})), pt = B(() => ({
|
|
1564
|
+
dates: lt.value,
|
|
1565
|
+
daysInWeek: V.value,
|
|
1566
|
+
enableKeyboadNavigate: E.value,
|
|
1567
|
+
enableMarkCurrent: _.value,
|
|
1568
|
+
enablePeriod: f.value,
|
|
1569
|
+
firstDayOfTheWeek: L.value,
|
|
1570
|
+
selected: o.value,
|
|
1571
|
+
selectedPeriod: j.value,
|
|
1572
|
+
selectMode: M.value,
|
|
1573
|
+
showWeekNumber: U.value,
|
|
1574
|
+
weekTitle: K.value
|
|
1575
|
+
}));
|
|
1576
|
+
function kt(u, C, P) {
|
|
1577
|
+
const {
|
|
1578
|
+
event: A,
|
|
1579
|
+
dayItem: ne
|
|
1580
|
+
} = u, le = ne.date;
|
|
1581
|
+
if (ne.tag === 1 ? he() : ne.tag === 3 && be(), !e.showTime)
|
|
1582
|
+
P === "start" ? S.value = le : o.value = le, a.emit("datePicked", le);
|
|
1583
|
+
else {
|
|
1584
|
+
const {
|
|
1585
|
+
year: At,
|
|
1586
|
+
month: Wt,
|
|
1587
|
+
day: Rt
|
|
1588
|
+
} = le;
|
|
1589
|
+
S.value.year = At, S.value.month = Wt, S.value.day = Rt;
|
|
1590
|
+
}
|
|
1591
|
+
const {
|
|
1592
|
+
year: Et,
|
|
1593
|
+
month: jt
|
|
1594
|
+
} = le;
|
|
1595
|
+
R.value = {
|
|
1596
|
+
year: Et,
|
|
1597
|
+
month: jt
|
|
1598
|
+
};
|
|
1599
|
+
}
|
|
1600
|
+
function qa(u) {
|
|
1601
|
+
}
|
|
1602
|
+
function za(u) {
|
|
1603
|
+
}
|
|
1604
|
+
function Ua(u, C) {
|
|
1605
|
+
}
|
|
1606
|
+
function Ga(u, C) {
|
|
1607
|
+
}
|
|
1608
|
+
function Oe(u, C, P = "start") {
|
|
1609
|
+
return se.value && m(Fa, ue(C, {
|
|
1610
|
+
onClick: (A) => kt(A, u, P),
|
|
1611
|
+
onClickWeek: (A) => void 0,
|
|
1612
|
+
onKeyDown: (A) => void 0,
|
|
1613
|
+
onMouseEnter: (A) => void 0,
|
|
1614
|
+
onMouseLeave: (A) => void 0
|
|
1615
|
+
}), null);
|
|
1616
|
+
}
|
|
1617
|
+
const Pt = B(() => ({
|
|
1618
|
+
months: rt.value,
|
|
1619
|
+
enableMarkCurrent: _.value,
|
|
1620
|
+
enableKeyboadNavigate: E.value,
|
|
1621
|
+
enablePeriod: f.value,
|
|
1622
|
+
selected: R.value,
|
|
1623
|
+
selectedPeriod: j.value
|
|
1624
|
+
})), Tt = B(() => ({
|
|
1625
|
+
months: Q.value,
|
|
1626
|
+
enableMarkCurrent: _.value,
|
|
1627
|
+
enableKeyboadNavigate: E.value,
|
|
1628
|
+
enablePeriod: f.value,
|
|
1629
|
+
selected: R.value,
|
|
1630
|
+
selectedPeriod: j.value
|
|
1631
|
+
}));
|
|
1632
|
+
function wt(u, C) {
|
|
1633
|
+
if (i.value = !1, h.value = !1, R.value = u, Y.value = {
|
|
1634
|
+
month: u.month || 1,
|
|
1635
|
+
displayTextOfMonth: l.value[u.month || "1"],
|
|
1636
|
+
year: u.year || 1,
|
|
1637
|
+
displayTextOfYear: `${u.year}`
|
|
1638
|
+
}, M.value === "month") {
|
|
1639
|
+
const P = oe(u);
|
|
1640
|
+
P.day = 1, a.emit("datePicked", P);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
function Xa(u) {
|
|
1644
|
+
}
|
|
1645
|
+
function Ja(u, C) {
|
|
1646
|
+
}
|
|
1647
|
+
function Qa(u, C) {
|
|
1648
|
+
}
|
|
1649
|
+
function Ne(u, C) {
|
|
1650
|
+
return m($a, ue(C, {
|
|
1651
|
+
onClick: (P) => wt(P),
|
|
1652
|
+
onKeyDownMonthView: (P) => void 0,
|
|
1653
|
+
onMouseEnterMonthView: (P) => void 0,
|
|
1654
|
+
onMouseLeaveMonthView: (P) => void 0
|
|
1655
|
+
}), null);
|
|
1656
|
+
}
|
|
1657
|
+
const Ct = B(() => ({
|
|
1658
|
+
years: me.value,
|
|
1659
|
+
enableKeyboadNavigate: E.value,
|
|
1660
|
+
enableMarkCurrent: _.value,
|
|
1661
|
+
enablePeriod: f.value,
|
|
1662
|
+
selected: S.value,
|
|
1663
|
+
selectedPeriod: j.value
|
|
1664
|
+
})), Dt = B(() => ({
|
|
1665
|
+
years: t.value,
|
|
1666
|
+
enableKeyboadNavigate: E.value,
|
|
1667
|
+
enableMarkCurrent: _.value,
|
|
1668
|
+
enablePeriod: f.value,
|
|
1669
|
+
selected: S.value,
|
|
1670
|
+
selectedPeriod: j.value
|
|
1671
|
+
}));
|
|
1672
|
+
function xt(u, C) {
|
|
1673
|
+
if (i.value = !0, h.value = !1, Y.value = {
|
|
1674
|
+
month: Y.value.month,
|
|
1675
|
+
displayTextOfMonth: Y.value.displayTextOfMonth,
|
|
1676
|
+
year: u.year || 1,
|
|
1677
|
+
displayTextOfYear: `${u.year}`
|
|
1678
|
+
}, M.value === "year") {
|
|
1679
|
+
const P = oe(u);
|
|
1680
|
+
P.month = 1, P.day = 1, a.emit("datePicked", P);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
function Za(u) {
|
|
1684
|
+
}
|
|
1685
|
+
function en(u, C) {
|
|
1686
|
+
}
|
|
1687
|
+
function tn(u, C) {
|
|
1688
|
+
}
|
|
1689
|
+
function Ot() {
|
|
1690
|
+
if (e.showTime)
|
|
1691
|
+
a.emit("confirm", S.value);
|
|
1692
|
+
else {
|
|
1693
|
+
const u = {
|
|
1694
|
+
startDate: {},
|
|
1695
|
+
endDate: {}
|
|
1696
|
+
};
|
|
1697
|
+
S.value && (u.startDate = S.value), o.value && (u.endDate = o.value), a.emit("confirm", u);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
function Nt(u) {
|
|
1701
|
+
Y.value = {
|
|
1702
|
+
year: H.year || 1,
|
|
1703
|
+
month: H.month || 1,
|
|
1704
|
+
displayTextOfMonth: l.value[H.month || "1"],
|
|
1705
|
+
displayTextOfYear: `${H.year}`
|
|
1706
|
+
}, S.value = oe(H), a.emit("datePicked", H);
|
|
1707
|
+
}
|
|
1708
|
+
function St(u) {
|
|
1709
|
+
Y.value = {
|
|
1710
|
+
year: H.year || 1,
|
|
1711
|
+
month: H.month || 1,
|
|
1712
|
+
displayTextOfMonth: l.value[H.month || "1"],
|
|
1713
|
+
displayTextOfYear: `${H.year}`
|
|
1714
|
+
}, S.value = oe(H), R.value = {
|
|
1715
|
+
year: H.year,
|
|
1716
|
+
month: H.month
|
|
1717
|
+
};
|
|
1718
|
+
}
|
|
1719
|
+
function Bt(u) {
|
|
1720
|
+
Y.value = {
|
|
1721
|
+
year: H.year || 1,
|
|
1722
|
+
month: H.month || 1,
|
|
1723
|
+
displayTextOfMonth: l.value[H.month || "1"],
|
|
1724
|
+
displayTextOfYear: `${H.year}`
|
|
1725
|
+
}, S.value = oe(H);
|
|
1726
|
+
}
|
|
1727
|
+
const Se = B(() => f.value && M.value !== "week"), Ht = B(() => se.value && Se.value || e.showTime);
|
|
1728
|
+
function Be(u, C) {
|
|
1729
|
+
return m(ja, ue(C, {
|
|
1730
|
+
onClick: (P) => xt(P),
|
|
1731
|
+
onKeyDownYearView: (P) => void 0,
|
|
1732
|
+
onClickPreRecord: (P) => he(),
|
|
1733
|
+
onClickNextRecord: (P) => be(),
|
|
1734
|
+
onMouseEnterYearView: (P) => void 0,
|
|
1735
|
+
onMouseLeaveYearView: (P) => void 0
|
|
1736
|
+
}), null);
|
|
1737
|
+
}
|
|
1738
|
+
function Yt() {
|
|
1739
|
+
const u = "HH:mm:ss";
|
|
1740
|
+
if (N.value) {
|
|
1741
|
+
const C = we(N.value, c.value);
|
|
1742
|
+
v.value = Te(C || "", u) || "00:00:00", S.value && (S.value.hour = (C == null ? void 0 : C.getHours()) || 0, S.value.minute = (C == null ? void 0 : C.getMinutes()) || 0, S.value.second = (C == null ? void 0 : C.getSeconds()) || 0);
|
|
1743
|
+
} else {
|
|
1744
|
+
const {
|
|
1745
|
+
hour: C,
|
|
1746
|
+
minute: P,
|
|
1747
|
+
second: A
|
|
1748
|
+
} = S.value;
|
|
1749
|
+
v.value = `${C || "0"}:${P || 0}:${A || 0}`, v.value = Lt(v.value);
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
ge(() => {
|
|
1753
|
+
e.showTime && Yt(), M.value === "month" ? (i.value = !0, h.value = !1) : M.value === "year" && (h.value = !0, i.value = !1);
|
|
1754
|
+
});
|
|
1755
|
+
const Ft = (u) => {
|
|
1756
|
+
v.value = u.text;
|
|
1757
|
+
const {
|
|
1758
|
+
hour: C,
|
|
1759
|
+
minute: P,
|
|
1760
|
+
second: A
|
|
1761
|
+
} = Kt(v.value);
|
|
1762
|
+
S.value && (S.value.hour = C || 0, S.value.minute = P || 0, S.value.second = A || 0);
|
|
1763
|
+
}, He = B(() => (u) => {
|
|
1764
|
+
const C = u.day == null || Pe.isDisabledDate(e.showTime ? u : {
|
|
1765
|
+
year: u.year,
|
|
1766
|
+
month: u.month,
|
|
1767
|
+
day: u.day
|
|
1768
|
+
});
|
|
1769
|
+
return {
|
|
1770
|
+
"pointer-events": C ? "none" : "auto",
|
|
1771
|
+
opacity: C ? 0.3 : 1
|
|
1772
|
+
};
|
|
1773
|
+
}), It = B(() => {
|
|
1774
|
+
const {
|
|
1775
|
+
year: u,
|
|
1776
|
+
month: C
|
|
1777
|
+
} = H, P = {
|
|
1778
|
+
year: te.value.year,
|
|
1779
|
+
month: te.value.month,
|
|
1780
|
+
day: te.value.day
|
|
1781
|
+
}, A = {
|
|
1782
|
+
year: ae.value.year,
|
|
1783
|
+
month: ae.value.month,
|
|
1784
|
+
day: ae.value.day
|
|
1785
|
+
}, ne = Ue({
|
|
1786
|
+
year: u,
|
|
1787
|
+
month: C,
|
|
1788
|
+
day: 1
|
|
1789
|
+
}, P) || Ge({
|
|
1790
|
+
year: u,
|
|
1791
|
+
month: C,
|
|
1792
|
+
day: tt(C || 0, u || 0)
|
|
1793
|
+
}, A);
|
|
1794
|
+
return {
|
|
1795
|
+
"pointer-events": ne ? "none" : "auto",
|
|
1796
|
+
opacity: ne ? 0.3 : 1
|
|
1797
|
+
};
|
|
1798
|
+
}), $t = B(() => {
|
|
1799
|
+
const u = H.year ? H.year >= ye.value && H.year <= fe.value : !1;
|
|
1800
|
+
return {
|
|
1801
|
+
"pointer-events": u ? "auto" : "none",
|
|
1802
|
+
opacity: u ? 1 : 0.3
|
|
1803
|
+
};
|
|
1804
|
+
});
|
|
1805
|
+
return () => m("div", {
|
|
1806
|
+
class: st.value,
|
|
1807
|
+
style: ut.value,
|
|
1808
|
+
tabindex: "0",
|
|
1809
|
+
onKeyup: (u) => void 0,
|
|
1810
|
+
onClick: (u) => dt(u)
|
|
1811
|
+
}, [m("div", {
|
|
1812
|
+
class: "f-datepicker-content",
|
|
1813
|
+
style: "width:287px"
|
|
1814
|
+
}, [xe(!1, mt.value), Oe(!1, gt.value), i.value && Ne(!1, Pt.value), h.value && Be(!1, Ct.value), m("div", {
|
|
1815
|
+
class: "f-datepicker-footer"
|
|
1816
|
+
}, [m("div", {
|
|
1817
|
+
class: "f-datepicker-redirect"
|
|
1818
|
+
}, [se.value && m("button", {
|
|
1819
|
+
class: "btn btn-link",
|
|
1820
|
+
style: He.value(H),
|
|
1821
|
+
onClick: Nt
|
|
1822
|
+
}, [ie("今天")]), bt.value && m("button", {
|
|
1823
|
+
class: "btn btn-link",
|
|
1824
|
+
style: It.value,
|
|
1825
|
+
onClick: St
|
|
1826
|
+
}, [ie("本月")]), Mt.value && m("button", {
|
|
1827
|
+
class: "btn btn-link",
|
|
1828
|
+
style: $t.value,
|
|
1829
|
+
onClick: Bt
|
|
1830
|
+
}, [ie("今年")])])])]), e.showTime && m("div", {
|
|
1831
|
+
class: "f-datepicker-content position-relative datepicker-content-has-timer",
|
|
1832
|
+
style: "width:200px"
|
|
1833
|
+
}, [m("div", {
|
|
1834
|
+
style: "height: 40px; border-bottom: 1px solid #E4E7EF; text-align: center; line-height: 40px; font-size: 16px; font-weight: 500;"
|
|
1835
|
+
}, [v.value]), m(Zt, {
|
|
1836
|
+
style: "top:41px;",
|
|
1837
|
+
ref: n,
|
|
1838
|
+
modelValue: v.value,
|
|
1839
|
+
onValueChange: Ft
|
|
1840
|
+
}, null)]), Se.value && m("div", {
|
|
1841
|
+
class: "f-datepicker-content"
|
|
1842
|
+
}, [xe(!0, ht.value), Oe(!0, pt.value, "end"), D.value && Ne(!0, Tt.value), p.value && Be(!0, Dt.value)]), Ht.value && m("div", {
|
|
1843
|
+
class: "f-datepicker-commitBtn-wrapper",
|
|
1844
|
+
style: "justify-content: end;"
|
|
1845
|
+
}, [m(ea, {
|
|
1846
|
+
onClick: Ot,
|
|
1847
|
+
style: He.value(S.value)
|
|
1848
|
+
}, {
|
|
1849
|
+
default: () => [ie("确定")]
|
|
1850
|
+
})])]);
|
|
1851
|
+
}
|
|
1852
|
+
}), Ka = /* @__PURE__ */ Z({
|
|
1853
|
+
name: "FDateViewDesign",
|
|
1854
|
+
props: va,
|
|
1855
|
+
emits: [],
|
|
1856
|
+
setup(e, a) {
|
|
1857
|
+
const n = r(), v = Me("design-item-context"), s = Fe(n, v);
|
|
1858
|
+
return ge(() => {
|
|
1859
|
+
n.value.componentInstance = s;
|
|
1860
|
+
}), a.expose(s.value), () => m(La, {
|
|
1861
|
+
ref: n
|
|
1862
|
+
}, null);
|
|
1863
|
+
}
|
|
1864
|
+
});
|
|
1865
|
+
de.register = (e, a, n, v) => {
|
|
1866
|
+
e["date-picker"] = qt, e["date-view"] = zt, a["date-picker"] = je, a["date-view"] = Re;
|
|
1867
|
+
};
|
|
1868
|
+
de.registerDesigner = (e, a, n) => {
|
|
1869
|
+
e["date-picker"] = de, e["date-view"] = Ka, a["date-picker"] = je, a["date-view"] = Re;
|
|
1870
|
+
};
|
|
1871
|
+
const mn = _t(de);
|
|
1872
|
+
export {
|
|
1873
|
+
de as FDatePickerDesign,
|
|
1874
|
+
fn as MAX_DATE,
|
|
1875
|
+
vn as MIN_DATE,
|
|
1876
|
+
da as datePickerDesignProps,
|
|
1877
|
+
je as datePickerPropsResolver,
|
|
1878
|
+
mn as default
|
|
1879
|
+
};
|