@farris/ui-vue 1.3.1 → 1.3.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/components/accordion/index.esm.js +103 -99
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +301 -351
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +444 -0
- package/components/binding-selector/index.umd.cjs +1 -0
- package/components/binding-selector/package.json +8 -0
- package/components/border-editor/index.esm.js +5 -3
- package/components/border-editor/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +143 -139
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +407 -396
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +266 -255
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +628 -641
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +379 -374
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +471 -471
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +155 -148
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +487 -478
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +330 -279
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1171 -1277
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +220 -204
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4743 -4641
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2916 -3019
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2375 -2590
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9518 -1198
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +2 -1
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +34 -38
- package/components/drawer/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +149 -138
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1602 -1740
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +159 -151
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +218 -218
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +311 -0
- package/components/event-parameter/index.umd.cjs +1 -0
- package/components/event-parameter/package.json +8 -0
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +533 -563
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +95 -91
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2356 -2455
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3048 -3308
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10537 -3249
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9781 -1327
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +353 -341
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +510 -827
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +278 -268
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +144 -136
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2139 -2237
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6414 -6367
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +5216 -5114
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +252 -252
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +70 -70
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +486 -984
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +446 -498
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +363 -388
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1050 -1308
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +134 -131
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1072 -1082
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +412 -910
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +214 -203
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1361 -1536
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +650 -677
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12344 -5048
- package/components/query-solution/index.umd.cjs +6 -1
- package/components/radio-button/index.esm.js +97 -97
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.css +1 -1
- package/components/radio-group/index.esm.js +1821 -565
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +251 -244
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +151 -140
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +707 -676
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +719 -740
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4977 -5249
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +145 -134
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +348 -337
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +141 -130
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +311 -301
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +231 -220
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +385 -432
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1932 -1914
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +351 -340
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +209 -199
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +388 -415
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +619 -666
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +493 -486
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3169 -3278
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2320 -2418
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +563 -554
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +287 -276
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +368 -324
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +498 -487
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +51302 -47651
- package/farris.all.umd.cjs +14 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/binding-selector/index.d.ts +55 -0
- package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
- package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
- package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
- package/types/combo-list/src/components/list-container.component.d.ts +6 -6
- package/types/combo-list/src/components/list-container.props.d.ts +1 -1
- package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +6 -6
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
- package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +2 -2
- package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
- package/types/date-picker/src/components/month/month.component.d.ts +3 -3
- package/types/date-picker/src/components/year/year.component.d.ts +3 -3
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -40
- package/types/designer-canvas/src/types.d.ts +8 -20
- package/types/dynamic-form/index.d.ts +1 -1
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +5 -0
- package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
- package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
- package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
- package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
- package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
- package/types/event-parameter/index.d.ts +31 -0
- package/types/event-parameter/src/composition/type.d.ts +77 -0
- package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
- package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
- package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
- package/types/field-selector/src/field-selector.component.d.ts +1 -2
- package/types/field-selector/src/field-selector.props.d.ts +0 -9
- package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
- package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
- package/types/list-view/src/list-view-table.component.d.ts +15 -0
- package/types/lookup/src/composition/use-user-data.d.ts +2 -2
- package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
- package/types/modal/src/composition/modal.service.d.ts +2 -1
- package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
- package/types/page-header/src/page-header.component.d.ts +1 -1
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
- package/types/property-panel/src/composition/type.d.ts +0 -13
- package/types/query-solution/src/composition/types.d.ts +35 -4
- package/types/query-solution/src/composition/use-header.d.ts +21 -0
- package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
- package/types/query-solution/src/composition/use-solution.d.ts +20 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +17 -16
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +3 -51
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
- package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
- package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/property-config/section.property-config.d.ts +17 -17
- package/types/section/src/schema/schema-resolver.d.ts +1 -2
- package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
- package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
- package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
- package/types/text/src/composition/types.d.ts +4 -4
- package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
- package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
- package/types/weather/src/composition/use-weather-color.d.ts +15 -0
- package/types/weather/src/composition/use-weather-data.d.ts +15 -0
- package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
- /package/types/dynamic-form/src/designer/{use-designer-rules.d.ts → response-form-use-designer-rules.d.ts} +0 -0
- /package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +0 -0
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isPlainObject as Z, cloneDeep as
|
|
1
|
+
import { defineComponent as F, ref as V, watch as $, computed as W, createVNode as c, onMounted as J, inject as se } from "vue";
|
|
2
|
+
import { isPlainObject as Z, cloneDeep as ce } from "lodash-es";
|
|
3
3
|
const K = {}, ee = {};
|
|
4
4
|
function U(e) {
|
|
5
|
-
const { properties: t, title:
|
|
6
|
-
|
|
5
|
+
const { properties: t, title: l, ignore: m } = e, y = m && Array.isArray(m), u = Object.keys(t).reduce((o, s) => ((!y || !m.find((k) => k === s)) && (o[s] = t[s].type === "object" && t[s].properties ? U(t[s]) : ce(t[s].default)), o), {});
|
|
6
|
+
if (l && (!y || !m.find((o) => o === "id"))) {
|
|
7
|
+
const o = l.toLowerCase().replace(/-/g, "_");
|
|
8
|
+
u.id = `${o}_${Math.random().toString().slice(2, 6)}`;
|
|
9
|
+
}
|
|
10
|
+
return u;
|
|
7
11
|
}
|
|
8
|
-
function ne(e, t = {},
|
|
12
|
+
function ne(e, t = {}, l) {
|
|
9
13
|
const m = K[e];
|
|
10
14
|
if (m) {
|
|
11
15
|
let y = U(m);
|
|
12
|
-
const
|
|
13
|
-
return y =
|
|
16
|
+
const u = ee[e];
|
|
17
|
+
return y = u ? u({ getSchemaByType: ne }, y, t, l) : y, y;
|
|
14
18
|
}
|
|
15
19
|
return null;
|
|
16
20
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
return Object.keys(
|
|
21
|
+
function le(e, t) {
|
|
22
|
+
const l = U(t);
|
|
23
|
+
return Object.keys(l).reduce((m, y) => (m[y] && Z(m[y]) && Z(e[y] || !e[y]) ? Object.assign(m[y], e[y] || {}) : m[y] = e[y], m), l), l;
|
|
20
24
|
}
|
|
21
25
|
function ue(e, t) {
|
|
22
26
|
return Object.keys(e).filter((m) => e[m] != null).reduce((m, y) => {
|
|
23
27
|
if (t.has(y)) {
|
|
24
|
-
const
|
|
25
|
-
if (typeof
|
|
26
|
-
m[
|
|
28
|
+
const u = t.get(y);
|
|
29
|
+
if (typeof u == "string")
|
|
30
|
+
m[u] = e[y];
|
|
27
31
|
else {
|
|
28
|
-
const o =
|
|
32
|
+
const o = u(y, e[y], e);
|
|
29
33
|
Object.assign(m, o);
|
|
30
34
|
}
|
|
31
35
|
} else
|
|
@@ -33,31 +37,31 @@ function ue(e, t) {
|
|
|
33
37
|
return m;
|
|
34
38
|
}, {});
|
|
35
39
|
}
|
|
36
|
-
function ie(e, t,
|
|
37
|
-
const m =
|
|
38
|
-
return ue(m,
|
|
40
|
+
function ie(e, t, l = /* @__PURE__ */ new Map()) {
|
|
41
|
+
const m = le(e, t);
|
|
42
|
+
return ue(m, l);
|
|
39
43
|
}
|
|
40
44
|
function de(e = {}) {
|
|
41
45
|
function t(n, p, g, b) {
|
|
42
46
|
if (typeof g == "number")
|
|
43
47
|
return b[n].length === g;
|
|
44
48
|
if (typeof g == "object") {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
49
|
+
const i = Object.keys(g)[0], f = g[i];
|
|
50
|
+
if (i === "not")
|
|
47
51
|
return Number(b[n].length) !== Number(f);
|
|
48
|
-
if (
|
|
52
|
+
if (i === "moreThan")
|
|
49
53
|
return Number(b[n].length) >= Number(f);
|
|
50
|
-
if (
|
|
54
|
+
if (i === "lessThan")
|
|
51
55
|
return Number(b[n].length) <= Number(f);
|
|
52
56
|
}
|
|
53
57
|
return !1;
|
|
54
58
|
}
|
|
55
|
-
function
|
|
59
|
+
function l(n, p, g, b) {
|
|
56
60
|
return b[n] && b[n].propertyValue && String(b[n].propertyValue.value) === String(g);
|
|
57
61
|
}
|
|
58
62
|
const m = /* @__PURE__ */ new Map([
|
|
59
63
|
["length", t],
|
|
60
|
-
["getProperty",
|
|
64
|
+
["getProperty", l]
|
|
61
65
|
]);
|
|
62
66
|
Object.keys(e).reduce((n, p) => (n.set(p, e[p]), n), m);
|
|
63
67
|
function y(n, p) {
|
|
@@ -65,14 +69,14 @@ function de(e = {}) {
|
|
|
65
69
|
return typeof p == "number" ? [{ target: g, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: g, operator: "getProperty", param: n, value: !!p }] : typeof p == "object" ? Object.keys(p).map((b) => {
|
|
66
70
|
if (b === "length")
|
|
67
71
|
return { target: g, operator: "length", param: null, value: p[b] };
|
|
68
|
-
const
|
|
69
|
-
return { target: g, operator: "getProperty", param:
|
|
72
|
+
const i = b, f = p[b];
|
|
73
|
+
return { target: g, operator: "getProperty", param: i, value: f };
|
|
70
74
|
}) : [];
|
|
71
75
|
}
|
|
72
|
-
function
|
|
76
|
+
function u(n) {
|
|
73
77
|
return Object.keys(n).reduce((g, b) => {
|
|
74
|
-
const
|
|
75
|
-
return g.push(...
|
|
78
|
+
const i = y(b, n[b]);
|
|
79
|
+
return g.push(...i), g;
|
|
76
80
|
}, []);
|
|
77
81
|
}
|
|
78
82
|
function o(n, p) {
|
|
@@ -83,19 +87,19 @@ function de(e = {}) {
|
|
|
83
87
|
return !1;
|
|
84
88
|
}
|
|
85
89
|
function s(n, p) {
|
|
86
|
-
return
|
|
90
|
+
return u(n).reduce((i, f) => i && o(f, p), !0);
|
|
87
91
|
}
|
|
88
92
|
function k(n, p) {
|
|
89
|
-
const g = Object.keys(n), b = g.includes("allOf"),
|
|
90
|
-
return b ? !
|
|
93
|
+
const g = Object.keys(n), b = g.includes("allOf"), i = g.includes("anyOf"), f = b || i, d = (f ? n[f ? b ? "allOf" : "anyOf" : "allOf"] : [n]).map((r) => s(r, p));
|
|
94
|
+
return b ? !d.includes(!1) : d.includes(!0);
|
|
91
95
|
}
|
|
92
96
|
return { parseValueSchema: k };
|
|
93
97
|
}
|
|
94
98
|
const ye = {}, ve = {};
|
|
95
99
|
de();
|
|
96
|
-
function fe(e, t,
|
|
97
|
-
return K[t.title] = t, ee[t.title] = m, ye[t.title] = y, ve[t.title] =
|
|
98
|
-
const s = ie(o, t,
|
|
100
|
+
function fe(e, t, l = /* @__PURE__ */ new Map(), m = (o, s, k, n) => s, y = {}, u = (o) => o) {
|
|
101
|
+
return K[t.title] = t, ee[t.title] = m, ye[t.title] = y, ve[t.title] = u, (o = {}) => {
|
|
102
|
+
const s = ie(o, t, l), k = Object.keys(e).reduce((n, p) => (n[p] = e[p].default, n), {});
|
|
99
103
|
return Object.assign(k, s);
|
|
100
104
|
};
|
|
101
105
|
}
|
|
@@ -105,7 +109,7 @@ function he(e, t) {
|
|
|
105
109
|
const me = /* @__PURE__ */ new Map([
|
|
106
110
|
["appearance", he]
|
|
107
111
|
]);
|
|
108
|
-
function pe(e, t,
|
|
112
|
+
function pe(e, t, l) {
|
|
109
113
|
return t;
|
|
110
114
|
}
|
|
111
115
|
const we = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-design.gitee.io/calendar.schema.json", ke = "calendar", De = "A Farris Input Component", be = "object", Me = {
|
|
@@ -142,7 +146,7 @@ const we = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
142
146
|
type: be,
|
|
143
147
|
properties: Me,
|
|
144
148
|
required: Te
|
|
145
|
-
},
|
|
149
|
+
}, Pe = "calendar", Ne = "A Farris Component", Oe = "object", We = {
|
|
146
150
|
basic: {
|
|
147
151
|
description: "Basic Infomation",
|
|
148
152
|
title: "基本信息",
|
|
@@ -164,16 +168,16 @@ const we = "https://json-schema.org/draft/2020-12/schema", ge = "https://farris-
|
|
|
164
168
|
}
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
|
-
},
|
|
168
|
-
title:
|
|
169
|
-
description:
|
|
170
|
-
type:
|
|
171
|
-
categories:
|
|
171
|
+
}, Ce = {
|
|
172
|
+
title: Pe,
|
|
173
|
+
description: Ne,
|
|
174
|
+
type: Oe,
|
|
175
|
+
categories: We
|
|
172
176
|
}, Q = {
|
|
173
177
|
events: { Type: Array, default: [] },
|
|
174
178
|
firstDayOfTheWeek: { type: String, default: "Sun." }
|
|
175
|
-
}, te = fe(Q, Ve, me, pe,
|
|
176
|
-
var
|
|
179
|
+
}, te = fe(Q, Ve, me, pe, Ce), I = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
180
|
+
var A = /* @__PURE__ */ ((e) => (e[e.previous = 1] = "previous", e[e.current = 2] = "current", e[e.next = 3] = "next", e))(A || {});
|
|
177
181
|
function z() {
|
|
178
182
|
function e() {
|
|
179
183
|
return { year: 0, month: 0, day: 0 };
|
|
@@ -189,7 +193,7 @@ function z() {
|
|
|
189
193
|
0
|
|
190
194
|
);
|
|
191
195
|
}
|
|
192
|
-
function
|
|
196
|
+
function l(n) {
|
|
193
197
|
const p = /* @__PURE__ */ new Date();
|
|
194
198
|
return n.year || (n.year = p.getFullYear()), n.month || (n.month = p.getMonth() + 1), n.day || (n.day = 1), new Date(
|
|
195
199
|
n.year,
|
|
@@ -213,17 +217,17 @@ function z() {
|
|
|
213
217
|
).getDay();
|
|
214
218
|
}
|
|
215
219
|
function y(n) {
|
|
216
|
-
return
|
|
220
|
+
return I.indexOf(n);
|
|
217
221
|
}
|
|
218
|
-
function
|
|
222
|
+
function u(n) {
|
|
219
223
|
return t(n).getTime();
|
|
220
224
|
}
|
|
221
225
|
function o(n) {
|
|
222
|
-
return Math.round(
|
|
226
|
+
return Math.round(u(n) / 1e3);
|
|
223
227
|
}
|
|
224
228
|
function s(n, p, g) {
|
|
225
|
-
const b =
|
|
226
|
-
return
|
|
229
|
+
const b = u(p), i = u(g), f = u(n);
|
|
230
|
+
return i - f > f - b ? p : g;
|
|
227
231
|
}
|
|
228
232
|
function k() {
|
|
229
233
|
const n = /* @__PURE__ */ new Date();
|
|
@@ -236,79 +240,79 @@ function z() {
|
|
|
236
240
|
second: n.getSeconds()
|
|
237
241
|
};
|
|
238
242
|
}
|
|
239
|
-
return { emptyDate: e, getDate: t, getDate2:
|
|
243
|
+
return { emptyDate: e, getDate: t, getDate2: l, getDayNumber: m, getEpocTime: o, getNearDate: s, getWeekdayIndex: y, getTimeInMilliseconds: u, getToday: k };
|
|
240
244
|
}
|
|
241
|
-
function
|
|
242
|
-
function e(
|
|
243
|
-
return new Date(o,
|
|
245
|
+
function Se() {
|
|
246
|
+
function e(u, o) {
|
|
247
|
+
return new Date(o, u, 0).getDate();
|
|
244
248
|
}
|
|
245
|
-
function t(
|
|
246
|
-
return new Date(
|
|
249
|
+
function t(u, o, s) {
|
|
250
|
+
return new Date(u, o - 1, s, 0, 0, 0, 0);
|
|
247
251
|
}
|
|
248
|
-
function
|
|
249
|
-
const s = t(o,
|
|
252
|
+
function l(u, o) {
|
|
253
|
+
const s = t(o, u, 1);
|
|
250
254
|
return s.setMonth(s.getMonth() - 1), e(s.getMonth() + 1, s.getFullYear());
|
|
251
255
|
}
|
|
252
|
-
function m(
|
|
256
|
+
function m(u, o) {
|
|
253
257
|
const s = {
|
|
254
|
-
year:
|
|
255
|
-
}, k =
|
|
258
|
+
year: u === 12 ? o + 1 : o
|
|
259
|
+
}, k = u === 12 ? 1 : u + 1;
|
|
256
260
|
return s.month = k, s;
|
|
257
261
|
}
|
|
258
|
-
function y(
|
|
262
|
+
function y(u, o) {
|
|
259
263
|
const s = {
|
|
260
|
-
year:
|
|
261
|
-
}, k =
|
|
264
|
+
year: u === 1 ? o - 1 : o
|
|
265
|
+
}, k = u === 1 ? 12 : u - 1;
|
|
262
266
|
return s.month = k, s;
|
|
263
267
|
}
|
|
264
|
-
return { daysInMonth: e, daysInPreMonth:
|
|
268
|
+
return { daysInMonth: e, daysInPreMonth: l, getNextMonth: m, getPreviousMonth: y };
|
|
265
269
|
}
|
|
266
270
|
function ae() {
|
|
267
|
-
const { getToday: e, getDayNumber: t } = z(), { daysInMonth:
|
|
271
|
+
const { getToday: e, getDayNumber: t } = z(), { daysInMonth: l, daysInPreMonth: m, getNextMonth: y, getPreviousMonth: u } = Se();
|
|
268
272
|
function o(h) {
|
|
269
|
-
const D =
|
|
273
|
+
const D = I.indexOf(h);
|
|
270
274
|
return D > 0 ? 7 - D : 0;
|
|
271
275
|
}
|
|
272
276
|
function s(h) {
|
|
273
|
-
const { day: D, month:
|
|
274
|
-
if (D === void 0 ||
|
|
277
|
+
const { day: D, month: d, year: a } = h;
|
|
278
|
+
if (D === void 0 || d === void 0 || a === void 0)
|
|
275
279
|
throw new Error("invalided date.");
|
|
276
|
-
const r = D === 1, w = r ? m(
|
|
280
|
+
const r = D === 1, w = r ? m(d, a) : D - 1, v = r ? d - 1 : d, M = v < 1, T = M ? 12 : v;
|
|
277
281
|
return {
|
|
278
|
-
year:
|
|
279
|
-
month:
|
|
282
|
+
year: M ? a - 1 : a,
|
|
283
|
+
month: T,
|
|
280
284
|
day: w
|
|
281
285
|
};
|
|
282
286
|
}
|
|
283
287
|
function k(h) {
|
|
284
|
-
const { day: D, month:
|
|
285
|
-
if (D === void 0 ||
|
|
288
|
+
const { day: D, month: d, year: a } = h;
|
|
289
|
+
if (D === void 0 || d === void 0 || a === void 0)
|
|
286
290
|
throw new Error("invalided date.");
|
|
287
|
-
const r =
|
|
291
|
+
const r = l(d, a), w = D === r, v = w ? 1 : D + 1, M = w ? d + 1 : d, T = M > 12, P = T ? 1 : M;
|
|
288
292
|
return {
|
|
289
|
-
year:
|
|
290
|
-
month:
|
|
293
|
+
year: T ? a + 1 : a,
|
|
294
|
+
month: P,
|
|
291
295
|
day: v
|
|
292
296
|
};
|
|
293
297
|
}
|
|
294
298
|
function n(h) {
|
|
295
|
-
const D =
|
|
299
|
+
const D = u(h.month || 1, h.year || 1), d = l(D.month || 1, D.year || 1);
|
|
296
300
|
return {
|
|
297
|
-
day: (h.day || 1) <=
|
|
301
|
+
day: (h.day || 1) <= d ? h.day : d,
|
|
298
302
|
month: D.month,
|
|
299
303
|
year: D.year
|
|
300
304
|
};
|
|
301
305
|
}
|
|
302
306
|
function p(h) {
|
|
303
|
-
const D = y(h.month || 1, h.year || 1),
|
|
307
|
+
const D = y(h.month || 1, h.year || 1), d = l(D.month || 1, D.year || 1);
|
|
304
308
|
return {
|
|
305
|
-
day: (h.day || 1) <=
|
|
309
|
+
day: (h.day || 1) <= d ? h.day : d,
|
|
306
310
|
month: D.month,
|
|
307
311
|
year: D.year
|
|
308
312
|
};
|
|
309
313
|
}
|
|
310
314
|
function g(h) {
|
|
311
|
-
const
|
|
315
|
+
const d = (h.day || 1) - 7, a = d < 1, r = a ? l(h.month || 1, h.year || 1) + d : d, w = a ? u(h.month || 1, h.year || 1) : h;
|
|
312
316
|
return {
|
|
313
317
|
day: r,
|
|
314
318
|
month: w.month,
|
|
@@ -316,45 +320,45 @@ function ae() {
|
|
|
316
320
|
};
|
|
317
321
|
}
|
|
318
322
|
function b(h) {
|
|
319
|
-
const
|
|
323
|
+
const d = (h.day || 1) + 7, a = l(h.month || 1, h.year || 1), r = d > a, w = r ? d - a : d, v = r ? y(h.month || 1, h.year || 1) : h;
|
|
320
324
|
return {
|
|
321
325
|
day: w,
|
|
322
326
|
month: v.month,
|
|
323
327
|
year: v.year
|
|
324
328
|
};
|
|
325
329
|
}
|
|
326
|
-
function
|
|
327
|
-
const r = { day: h, month: D, year:
|
|
328
|
-
let
|
|
329
|
-
const
|
|
330
|
-
for (let
|
|
331
|
-
const R =
|
|
332
|
-
|
|
330
|
+
function i(h, D, d, a) {
|
|
331
|
+
const r = { day: h, month: D, year: d }, v = o(a) === 0 ? 1 : 0, M = t(r) + v, T = e();
|
|
332
|
+
let P = s(r);
|
|
333
|
+
const S = [];
|
|
334
|
+
for (let j = M - 1; j >= 1; j--) {
|
|
335
|
+
const R = P.month !== r.month ? A.previous : A.current, O = P.month === D && P.day === T.day && P.month === T.month && P.year === T.year;
|
|
336
|
+
S.push({ date: P, monthTag: R, isCurrent: O }), j > 1 && (P = s(P));
|
|
333
337
|
}
|
|
334
|
-
let
|
|
338
|
+
let C = k(r);
|
|
335
339
|
const E = [];
|
|
336
|
-
for (let
|
|
337
|
-
const R =
|
|
338
|
-
E.push({ date:
|
|
340
|
+
for (let j = M + 1; j <= 7; j++) {
|
|
341
|
+
const R = P.month !== r.month ? A.next : A.current, O = C.day === T.day && C.month === T.month && C.year === T.year;
|
|
342
|
+
E.push({ date: C, monthTag: R, isCurrent: O }), j < 7 && (C = k(C));
|
|
339
343
|
}
|
|
340
|
-
const
|
|
344
|
+
const N = h === T.day && D === T.month && d === T.year;
|
|
341
345
|
return {
|
|
342
|
-
days: [...
|
|
346
|
+
days: [...S.reverse(), { date: r, monthTag: A.current, isCurrent: N }, ...E],
|
|
343
347
|
weekNumber: 0,
|
|
344
|
-
year:
|
|
348
|
+
year: d
|
|
345
349
|
};
|
|
346
350
|
}
|
|
347
|
-
function f(h, D,
|
|
348
|
-
const a = [], r =
|
|
351
|
+
function f(h, D, d) {
|
|
352
|
+
const a = [], r = l(h, D);
|
|
349
353
|
for (let w = 1; w <= r; w += 7) {
|
|
350
|
-
const v =
|
|
354
|
+
const v = i(w, h, D, d);
|
|
351
355
|
a.push(v);
|
|
352
356
|
}
|
|
353
357
|
return a;
|
|
354
358
|
}
|
|
355
359
|
return {
|
|
356
360
|
getMonthlyCalendar: f,
|
|
357
|
-
getWeeklyCalendar:
|
|
361
|
+
getWeeklyCalendar: i,
|
|
358
362
|
getPreviousDay: s,
|
|
359
363
|
getNextDay: k,
|
|
360
364
|
getDayInPreviousWeek: g,
|
|
@@ -363,53 +367,53 @@ function ae() {
|
|
|
363
367
|
getDayInNextMonth: p
|
|
364
368
|
};
|
|
365
369
|
}
|
|
366
|
-
function
|
|
370
|
+
function H() {
|
|
367
371
|
const { getTimeInMilliseconds: e } = z();
|
|
368
|
-
function t(
|
|
369
|
-
return
|
|
372
|
+
function t(i) {
|
|
373
|
+
return i && i.year !== 0 && i.month !== 0 && i.day !== 0;
|
|
370
374
|
}
|
|
371
|
-
function i
|
|
372
|
-
return
|
|
375
|
+
function l(i) {
|
|
376
|
+
return i && i.year !== 0 && i.month !== 0;
|
|
373
377
|
}
|
|
374
|
-
function m(
|
|
375
|
-
return
|
|
378
|
+
function m(i) {
|
|
379
|
+
return i && i.year !== 0;
|
|
376
380
|
}
|
|
377
|
-
function y(
|
|
378
|
-
return e(
|
|
381
|
+
function y(i, f) {
|
|
382
|
+
return e(i) < e(f);
|
|
379
383
|
}
|
|
380
|
-
function
|
|
381
|
-
return e(
|
|
384
|
+
function u(i, f) {
|
|
385
|
+
return e(i) <= e(f);
|
|
382
386
|
}
|
|
383
|
-
function o(
|
|
384
|
-
return e(
|
|
387
|
+
function o(i, f) {
|
|
388
|
+
return e(i) === e(f);
|
|
385
389
|
}
|
|
386
|
-
function s(
|
|
390
|
+
function s(i, f) {
|
|
387
391
|
const h = e(f);
|
|
388
|
-
return e(
|
|
392
|
+
return e(i.from) === h || e(i.to) === h;
|
|
389
393
|
}
|
|
390
|
-
function k(
|
|
391
|
-
return !f || !t(f.to) || !t(f.from) ? !1 :
|
|
394
|
+
function k(i, f) {
|
|
395
|
+
return !f || !t(f.to) || !t(f.from) ? !1 : u(f.from, i) && u(i, f.to);
|
|
392
396
|
}
|
|
393
|
-
function n(
|
|
394
|
-
return t(f) && e(
|
|
397
|
+
function n(i, f) {
|
|
398
|
+
return t(f) && e(i) >= e(f);
|
|
395
399
|
}
|
|
396
|
-
function p(
|
|
397
|
-
return t(f) && e(
|
|
400
|
+
function p(i, f) {
|
|
401
|
+
return t(f) && e(i) <= e(f);
|
|
398
402
|
}
|
|
399
|
-
function g(
|
|
400
|
-
return e({ year:
|
|
403
|
+
function g(i, f) {
|
|
404
|
+
return e({ year: i.year, month: i.month, day: i.day }) === e({ year: f.year, month: f.month, day: f.day });
|
|
401
405
|
}
|
|
402
|
-
function b(
|
|
403
|
-
return e({ hour:
|
|
406
|
+
function b(i, f) {
|
|
407
|
+
return e({ hour: i.hour, minute: i.minute, second: i.second }) === e({ hour: f.hour, minute: f.minute, second: f.second });
|
|
404
408
|
}
|
|
405
409
|
return {
|
|
406
410
|
isDateEarlier: y,
|
|
407
411
|
equal: o,
|
|
408
412
|
inPeriod: k,
|
|
409
413
|
isPoint: s,
|
|
410
|
-
equalOrEarlier:
|
|
414
|
+
equalOrEarlier: u,
|
|
411
415
|
isInitializedDate: t,
|
|
412
|
-
isInitializedMonth:
|
|
416
|
+
isInitializedMonth: l,
|
|
413
417
|
isInitializedYear: m,
|
|
414
418
|
isMonthDisabledByDisableSince: n,
|
|
415
419
|
isMonthDisabledByDisableUntil: p,
|
|
@@ -430,29 +434,29 @@ const X = {
|
|
|
430
434
|
10: "Oct",
|
|
431
435
|
11: "Nov",
|
|
432
436
|
12: "Dec"
|
|
433
|
-
},
|
|
437
|
+
}, je = {
|
|
434
438
|
activeView: { Type: Number, default: 3 },
|
|
435
439
|
title: { Type: String, default: "" },
|
|
436
440
|
dailyViewTitle: { Type: String, default: "Day" },
|
|
437
441
|
weeklyViewTitle: { Type: String, default: "Week" },
|
|
438
442
|
monthlyViewTitle: { Type: String, default: "Month" }
|
|
439
|
-
},
|
|
443
|
+
}, _ = /* @__PURE__ */ F({
|
|
440
444
|
name: "FCalendarHeader",
|
|
441
|
-
props:
|
|
445
|
+
props: je,
|
|
442
446
|
emits: ["ViewChange", "Previous", "Next", "ResetToToday"],
|
|
443
447
|
setup(e, t) {
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
|
|
448
|
+
const l = V(e.title), m = V(e.dailyViewTitle), y = V(e.weeklyViewTitle), u = V(e.monthlyViewTitle), o = 2, s = 62, k = V(e.activeView), n = V("Today");
|
|
449
|
+
$(() => e.title, () => {
|
|
450
|
+
l.value = e.title;
|
|
447
451
|
});
|
|
448
|
-
const p =
|
|
452
|
+
const p = W(() => ({
|
|
449
453
|
top: `${o}px`,
|
|
450
454
|
left: `${k.value * (o + 1) + (k.value - 1) * (s + 1)}px`
|
|
451
|
-
})), g =
|
|
455
|
+
})), g = W(() => k.value === 1 ? m.value : k.value === 2 ? y.value : u.value);
|
|
452
456
|
function b() {
|
|
453
457
|
k.value = 1, t.emit("ViewChange", 1);
|
|
454
458
|
}
|
|
455
|
-
function
|
|
459
|
+
function i() {
|
|
456
460
|
k.value = 2, t.emit("ViewChange", 2);
|
|
457
461
|
}
|
|
458
462
|
function f() {
|
|
@@ -464,155 +468,155 @@ const X = {
|
|
|
464
468
|
function D() {
|
|
465
469
|
t.emit("Next", k.value);
|
|
466
470
|
}
|
|
467
|
-
function
|
|
471
|
+
function d() {
|
|
468
472
|
t.emit("ResetToToday");
|
|
469
473
|
}
|
|
470
|
-
return () =>
|
|
474
|
+
return () => c("div", {
|
|
471
475
|
class: "f-calendar-header"
|
|
472
|
-
}, [
|
|
476
|
+
}, [c("div", {
|
|
473
477
|
class: "f-calendar-title"
|
|
474
|
-
}, [
|
|
478
|
+
}, [l.value]), c("div", {
|
|
475
479
|
class: "f-calendar-navigator"
|
|
476
|
-
}, [
|
|
480
|
+
}, [c("div", {
|
|
477
481
|
class: "f-calendar-navigator-today btn btn-default",
|
|
478
|
-
onClick: () =>
|
|
479
|
-
}, [n.value]),
|
|
482
|
+
onClick: () => d()
|
|
483
|
+
}, [n.value]), c("div", {
|
|
480
484
|
class: "f-calendar-navigator-button-group"
|
|
481
|
-
}, [
|
|
485
|
+
}, [c("div", {
|
|
482
486
|
class: "f-calendar-navigator-previous btn btn-default",
|
|
483
487
|
onClick: () => h()
|
|
484
|
-
}, [
|
|
488
|
+
}, [c("i", {
|
|
485
489
|
class: "f-icon f-icon-arrow-chevron-left"
|
|
486
|
-
}, null)]),
|
|
490
|
+
}, null)]), c("div", {
|
|
487
491
|
class: "f-calendar-navigator-next btn btn-default",
|
|
488
492
|
onClick: () => D()
|
|
489
|
-
}, [
|
|
493
|
+
}, [c("i", {
|
|
490
494
|
class: "f-icon f-icon-arrow-chevron-right"
|
|
491
|
-
}, null)])])]),
|
|
495
|
+
}, null)])])]), c("div", {
|
|
492
496
|
class: "f-calendar-view-switch"
|
|
493
|
-
}, [
|
|
497
|
+
}, [c("div", {
|
|
494
498
|
class: "f-calendar-view-switch-panel"
|
|
495
|
-
}, [
|
|
499
|
+
}, [c("span", {
|
|
496
500
|
class: "f-calendar-view-switch-daily",
|
|
497
501
|
onClick: (a) => b()
|
|
498
|
-
}, [m.value]),
|
|
502
|
+
}, [m.value]), c("span", {
|
|
499
503
|
class: "f-calendar-view-switch-weekly",
|
|
500
|
-
onClick: (a) =>
|
|
501
|
-
}, [y.value]),
|
|
504
|
+
onClick: (a) => i()
|
|
505
|
+
}, [y.value]), c("span", {
|
|
502
506
|
class: "f-calendar-view-switch-monthly",
|
|
503
507
|
onClick: (a) => f()
|
|
504
|
-
}, [
|
|
508
|
+
}, [u.value])]), c("div", {
|
|
505
509
|
class: "f-calendar-view-switch-active-view",
|
|
506
510
|
style: p.value
|
|
507
511
|
}, [g.value])])]);
|
|
508
512
|
}
|
|
509
|
-
}),
|
|
513
|
+
}), Ae = {
|
|
510
514
|
dates: { Type: Array, default: [] },
|
|
511
|
-
daysInWeek: { Type: Array, default:
|
|
515
|
+
daysInWeek: { Type: Array, default: I },
|
|
512
516
|
enableKeyboadNavigate: { Type: Boolean, default: !0 },
|
|
513
517
|
enableMarkCurrent: { Type: Boolean, default: !0 },
|
|
514
518
|
events: { Type: Array, default: [] },
|
|
515
519
|
activeDay: { Type: Object, default: null }
|
|
516
520
|
};
|
|
517
|
-
var
|
|
521
|
+
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 || {});
|
|
518
522
|
function Ee() {
|
|
519
523
|
function e(t) {
|
|
520
|
-
const
|
|
521
|
-
return
|
|
524
|
+
const l = t.key || t.keyCode;
|
|
525
|
+
return l === "Enter" || l === 13 ? 13 : l === "Escape" || l === 27 ? 27 : l === " " || l === 32 ? 32 : l === "ArrowLeft" || l === 37 ? 37 : l === "ArrowUp" || l === 38 ? 38 : l === "ArrowRight" || l === 39 ? 39 : l === "ArrowDown" || l === 40 ? 40 : l === "Tab" || l === 9 ? 9 : l === "Shift" || l === 16 ? 16 : -1;
|
|
522
526
|
}
|
|
523
527
|
return { getKeyCodeFromEvent: e };
|
|
524
528
|
}
|
|
525
|
-
const
|
|
529
|
+
const x = /* @__PURE__ */ F({
|
|
526
530
|
name: "FCalendarMonthView",
|
|
527
|
-
props:
|
|
531
|
+
props: Ae,
|
|
528
532
|
emits: ["click", "keyDown"],
|
|
529
533
|
setup(e, t) {
|
|
530
|
-
const
|
|
534
|
+
const l = V(e.daysInWeek), m = V(e.enableKeyboadNavigate), y = V(e.enableMarkCurrent), u = V(e.activeDay), o = V(e.events), {
|
|
531
535
|
equal: s,
|
|
532
536
|
sameDay: k
|
|
533
|
-
} =
|
|
537
|
+
} = H(), {
|
|
534
538
|
getKeyCodeFromEvent: n
|
|
535
539
|
} = Ee();
|
|
536
|
-
function p(
|
|
537
|
-
return
|
|
540
|
+
function p(d, a) {
|
|
541
|
+
return d.forEach((r) => {
|
|
538
542
|
r.days.forEach((w) => {
|
|
539
|
-
const v = a.filter((
|
|
543
|
+
const v = a.filter((M) => k(M.starts, w.date));
|
|
540
544
|
v && v.length && (w.events = [...v]);
|
|
541
545
|
});
|
|
542
|
-
}),
|
|
546
|
+
}), d;
|
|
543
547
|
}
|
|
544
|
-
const g =
|
|
545
|
-
|
|
548
|
+
const g = V(p(e.dates, o.value));
|
|
549
|
+
$(() => e.dates, () => {
|
|
546
550
|
g.value = p(e.dates, o.value);
|
|
547
|
-
}),
|
|
548
|
-
|
|
549
|
-
}),
|
|
551
|
+
}), $(() => e.activeDay, () => {
|
|
552
|
+
u.value = e.activeDay;
|
|
553
|
+
}), $(() => e.events, () => {
|
|
550
554
|
o.value = e.events;
|
|
551
555
|
});
|
|
552
|
-
function b(
|
|
553
|
-
return !!
|
|
554
|
-
year:
|
|
555
|
-
month:
|
|
556
|
-
day:
|
|
557
|
-
},
|
|
556
|
+
function b(d) {
|
|
557
|
+
return !!u.value && s({
|
|
558
|
+
year: u.value.year,
|
|
559
|
+
month: u.value.month,
|
|
560
|
+
day: u.value.day
|
|
561
|
+
}, d);
|
|
558
562
|
}
|
|
559
|
-
const
|
|
563
|
+
const i = (d, a, r) => {
|
|
560
564
|
const v = {
|
|
561
|
-
"f-datepicker-no-currmonth":
|
|
562
|
-
},
|
|
563
|
-
return v[
|
|
564
|
-
}, f = (
|
|
565
|
-
const a =
|
|
565
|
+
"f-datepicker-no-currmonth": d.monthTag === A.previous || d.monthTag === A.next
|
|
566
|
+
}, M = `d_${a}_${r}`;
|
|
567
|
+
return v[M] = !0, v;
|
|
568
|
+
}, f = (d) => {
|
|
569
|
+
const a = d.monthTag === A.current && b(d.date), r = d.isCurrent && y.value;
|
|
566
570
|
return {
|
|
567
571
|
"f-calendar-month-view-date": !0,
|
|
568
572
|
"f-calendar-month-view-selected": a,
|
|
569
573
|
"f-calendar-month-view-current": r
|
|
570
574
|
};
|
|
571
575
|
};
|
|
572
|
-
function h(
|
|
573
|
-
|
|
576
|
+
function h(d, a) {
|
|
577
|
+
d.stopPropagation(), t.emit("click", a.date);
|
|
574
578
|
}
|
|
575
|
-
function D(
|
|
576
|
-
const r = n(
|
|
577
|
-
r !==
|
|
579
|
+
function D(d, a) {
|
|
580
|
+
const r = n(d);
|
|
581
|
+
r !== G.tab && (d.preventDefault(), r === G.enter || r === G.space ? h(d, a) : m.value && t.emit("keyDown", a.date));
|
|
578
582
|
}
|
|
579
|
-
return () =>
|
|
583
|
+
return () => c("div", {
|
|
580
584
|
class: "f-calendar-month-view"
|
|
581
|
-
}, [
|
|
585
|
+
}, [c("table", {
|
|
582
586
|
class: "f-datepicker-table",
|
|
583
587
|
cellpadding: "0"
|
|
584
|
-
}, [
|
|
588
|
+
}, [c("thead", null, [c("tr", null, [l.value && l.value.map((d) => c("th", {
|
|
585
589
|
scope: "col",
|
|
586
590
|
style: "padding: 4px 4px 8px"
|
|
587
|
-
}, [
|
|
591
|
+
}, [d]))])]), c("tbody", null, [g.value && g.value.map((d, a) => c("tr", null, [d.days && d.days.map((r, w) => c("td", {
|
|
588
592
|
id: `d_${a}_${w}`,
|
|
589
593
|
tabindex: "0",
|
|
590
|
-
class:
|
|
594
|
+
class: i(r, a, w),
|
|
591
595
|
onClick: (v) => h(v, r),
|
|
592
596
|
onKeydown: (v) => D(v, r)
|
|
593
|
-
}, [
|
|
597
|
+
}, [c("div", {
|
|
594
598
|
class: "f-calendar-month-view-title"
|
|
595
|
-
}, [
|
|
599
|
+
}, [c("div", {
|
|
596
600
|
class: f(r)
|
|
597
|
-
}, [r.date.day]),
|
|
601
|
+
}, [r.date.day]), c("div", {
|
|
598
602
|
class: "f-calendar-month-view-date-month"
|
|
599
|
-
}, [r.date.day === 1 ? X[r.date.month || 1] : ""])]), r.events && r.events.length && r.events.map((v) =>
|
|
603
|
+
}, [r.date.day === 1 ? X[r.date.month || 1] : ""])]), r.events && r.events.length && r.events.map((v) => c("div", {
|
|
600
604
|
class: "f-calendar-month-view-event-item"
|
|
601
605
|
}, [v.title]))]))]))])])]);
|
|
602
606
|
}
|
|
603
|
-
}),
|
|
604
|
-
daysInWeek: { Type: Array, default:
|
|
607
|
+
}), $e = {
|
|
608
|
+
daysInWeek: { Type: Array, default: I },
|
|
605
609
|
enableMarkCurrent: { Type: Boolean, default: !0 },
|
|
606
610
|
events: { Type: Array, default: [] },
|
|
607
611
|
week: { Type: Object, default: { days: [], weekNumber: 0, year: 0 } }
|
|
608
|
-
},
|
|
612
|
+
}, Y = /* @__PURE__ */ F({
|
|
609
613
|
name: "FCalendarWeekView",
|
|
610
|
-
props:
|
|
614
|
+
props: $e,
|
|
611
615
|
emits: [],
|
|
612
616
|
setup(e) {
|
|
613
|
-
const t =
|
|
617
|
+
const t = V(), l = V(), m = V(e.daysInWeek), y = V(e.week), u = V(e.enableMarkCurrent), o = V(e.events), s = V([]), {
|
|
614
618
|
equal: k
|
|
615
|
-
} =
|
|
619
|
+
} = H();
|
|
616
620
|
function n(a) {
|
|
617
621
|
return y.value.days.map((w) => {
|
|
618
622
|
const v = {
|
|
@@ -622,10 +626,10 @@ const Y = /* @__PURE__ */ B({
|
|
|
622
626
|
hour: a.hour,
|
|
623
627
|
minute: a.minute,
|
|
624
628
|
second: a.second
|
|
625
|
-
},
|
|
629
|
+
}, M = o.value.filter((T) => k(T.starts, v));
|
|
626
630
|
return {
|
|
627
631
|
day: v,
|
|
628
|
-
events:
|
|
632
|
+
events: M
|
|
629
633
|
};
|
|
630
634
|
});
|
|
631
635
|
}
|
|
@@ -640,53 +644,53 @@ const Y = /* @__PURE__ */ B({
|
|
|
640
644
|
hour: r,
|
|
641
645
|
minute: 30,
|
|
642
646
|
second: 0
|
|
643
|
-
},
|
|
647
|
+
}, M = n(w), T = n(v);
|
|
644
648
|
a.push({
|
|
645
649
|
time: w,
|
|
646
|
-
events:
|
|
650
|
+
events: M,
|
|
647
651
|
title: r > 0 ? `${r}:00` : "",
|
|
648
652
|
part: "upper"
|
|
649
653
|
}), a.push({
|
|
650
654
|
time: v,
|
|
651
|
-
events:
|
|
655
|
+
events: T,
|
|
652
656
|
title: `${r}:30`,
|
|
653
657
|
part: "lower"
|
|
654
658
|
});
|
|
655
659
|
}
|
|
656
660
|
s.value = a;
|
|
657
661
|
}
|
|
658
|
-
p(),
|
|
662
|
+
p(), $(() => e.week, () => {
|
|
659
663
|
y.value = e.week, p();
|
|
660
|
-
}),
|
|
664
|
+
}), $(() => e.events, () => {
|
|
661
665
|
o.value = e.events, p();
|
|
662
666
|
});
|
|
663
667
|
const g = (a) => ({
|
|
664
668
|
"f-calendar-week-view-date": !0,
|
|
665
|
-
"f-calendar-week-view-current": a.isCurrent &&
|
|
669
|
+
"f-calendar-week-view-current": a.isCurrent && u.value
|
|
666
670
|
});
|
|
667
671
|
function b() {
|
|
668
|
-
return
|
|
672
|
+
return c("div", {
|
|
669
673
|
class: "f-calendar-week-view-header"
|
|
670
|
-
}, [
|
|
674
|
+
}, [c("div", {
|
|
671
675
|
class: "f-calendar-week-view-header-corner"
|
|
672
|
-
}, null),
|
|
676
|
+
}, null), c("div", {
|
|
673
677
|
class: "f-calendar-week-view-header-primary"
|
|
674
|
-
}, [
|
|
678
|
+
}, [c("div", {
|
|
675
679
|
class: "f-calendar-week-view-header-columns"
|
|
676
|
-
}, [m.value.map((a, r) =>
|
|
680
|
+
}, [m.value.map((a, r) => c("div", {
|
|
677
681
|
class: "f-calendar-week-view-header-cell"
|
|
678
|
-
}, [
|
|
682
|
+
}, [c("div", {
|
|
679
683
|
class: g(y.value.days[r])
|
|
680
|
-
}, [y.value.days[r].date.day]),
|
|
684
|
+
}, [y.value.days[r].date.day]), c("span", null, [a])]))])])]);
|
|
681
685
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
686
|
+
function i() {
|
|
687
|
+
return c("div", {
|
|
684
688
|
class: "f-calendar-week-view-content-side"
|
|
685
|
-
}, [
|
|
689
|
+
}, [c("div", {
|
|
686
690
|
class: "f-calendar-side"
|
|
687
|
-
}, [s.value.map((a) =>
|
|
691
|
+
}, [s.value.map((a) => c("div", {
|
|
688
692
|
class: "f-calendar-side-row"
|
|
689
|
-
}, [
|
|
693
|
+
}, [c("div", {
|
|
690
694
|
class: "f-calendar-side-row-number"
|
|
691
695
|
}, [a.part === "upper" ? a.title : ""])]))])]);
|
|
692
696
|
}
|
|
@@ -698,51 +702,51 @@ const Y = /* @__PURE__ */ B({
|
|
|
698
702
|
};
|
|
699
703
|
}
|
|
700
704
|
function h(a) {
|
|
701
|
-
const
|
|
705
|
+
const P = (a.starts.hour || 0) + (a.starts.minute || 0) / 60;
|
|
702
706
|
return {
|
|
703
|
-
height: `${44 * ((a.ends.hour || 0) + (a.ends.minute || 0) / 60 -
|
|
707
|
+
height: `${44 * ((a.ends.hour || 0) + (a.ends.minute || 0) / 60 - P) - 2 - 2 - 1 - 1}px`
|
|
704
708
|
};
|
|
705
709
|
}
|
|
706
710
|
function D() {
|
|
707
|
-
return s.value.map((a) =>
|
|
711
|
+
return s.value.map((a) => c("div", {
|
|
708
712
|
class: f(a)
|
|
709
|
-
}, [a.events.map((r) =>
|
|
713
|
+
}, [a.events.map((r) => c("div", {
|
|
710
714
|
class: "f-calendar-week-view-item-cell"
|
|
711
|
-
}, [r.events.length > 0 && r.events.map((w) =>
|
|
715
|
+
}, [r.events.length > 0 && r.events.map((w) => c("div", {
|
|
712
716
|
class: "f-calendar-event",
|
|
713
717
|
style: h(w)
|
|
714
718
|
}, [w.title]))]))]));
|
|
715
719
|
}
|
|
716
|
-
function
|
|
717
|
-
return
|
|
718
|
-
ref:
|
|
720
|
+
function d() {
|
|
721
|
+
return c("div", {
|
|
722
|
+
ref: l,
|
|
719
723
|
class: "f-calendar-content-primary"
|
|
720
|
-
}, [
|
|
724
|
+
}, [c("div", {
|
|
721
725
|
class: "f-calendar-content-data"
|
|
722
726
|
}, [D()])]);
|
|
723
727
|
}
|
|
724
728
|
return J(() => {
|
|
725
729
|
t.value && t.value.scrollTo(0, 250);
|
|
726
|
-
}), () =>
|
|
730
|
+
}), () => c("div", {
|
|
727
731
|
class: "f-calendar-week-view"
|
|
728
|
-
}, [b(),
|
|
732
|
+
}, [b(), c("div", {
|
|
729
733
|
class: "f-calendar-week-view-content",
|
|
730
734
|
ref: t
|
|
731
|
-
}, [
|
|
735
|
+
}, [i(), d()])]);
|
|
732
736
|
}
|
|
733
|
-
}),
|
|
737
|
+
}), Be = {
|
|
734
738
|
day: { Type: Object, default: {} },
|
|
735
739
|
dayInWeek: { Type: String, default: "" },
|
|
736
740
|
enableMarkCurrent: { Type: Boolean, default: !0 },
|
|
737
741
|
events: { Type: Array, default: [] }
|
|
738
|
-
}, L = /* @__PURE__ */
|
|
742
|
+
}, L = /* @__PURE__ */ F({
|
|
739
743
|
name: "FCalendarDayView",
|
|
740
|
-
props:
|
|
744
|
+
props: Be,
|
|
741
745
|
emits: [],
|
|
742
746
|
setup(e) {
|
|
743
|
-
const t =
|
|
747
|
+
const t = V(), l = V(), m = V(e.dayInWeek), y = V(e.day), u = V(e.enableMarkCurrent), o = V(e.events), s = V([]), {
|
|
744
748
|
equal: k
|
|
745
|
-
} =
|
|
749
|
+
} = H();
|
|
746
750
|
function n(a) {
|
|
747
751
|
const r = {
|
|
748
752
|
year: y.value.date.year,
|
|
@@ -768,53 +772,53 @@ const Y = /* @__PURE__ */ B({
|
|
|
768
772
|
hour: r,
|
|
769
773
|
minute: 30,
|
|
770
774
|
second: 0
|
|
771
|
-
},
|
|
775
|
+
}, M = n(w), T = n(v);
|
|
772
776
|
a.push({
|
|
773
777
|
time: w,
|
|
774
|
-
events:
|
|
778
|
+
events: M,
|
|
775
779
|
title: r > 0 ? `${r}:00` : "",
|
|
776
780
|
part: "upper"
|
|
777
781
|
}), a.push({
|
|
778
782
|
time: v,
|
|
779
|
-
events:
|
|
783
|
+
events: T,
|
|
780
784
|
title: `${r}:30`,
|
|
781
785
|
part: "lower"
|
|
782
786
|
});
|
|
783
787
|
}
|
|
784
788
|
s.value = a;
|
|
785
789
|
}
|
|
786
|
-
p(),
|
|
790
|
+
p(), $(() => e.day, () => {
|
|
787
791
|
y.value = e.day, p();
|
|
788
|
-
}),
|
|
792
|
+
}), $(() => e.events, () => {
|
|
789
793
|
o.value = e.events, p();
|
|
790
794
|
});
|
|
791
795
|
const g = (a) => ({
|
|
792
796
|
"f-calendar-day-view-date": !0,
|
|
793
|
-
"f-calendar-day-view-current": a.isCurrent &&
|
|
797
|
+
"f-calendar-day-view-current": a.isCurrent && u.value
|
|
794
798
|
});
|
|
795
799
|
function b() {
|
|
796
|
-
return
|
|
800
|
+
return c("div", {
|
|
797
801
|
class: "f-calendar-day-view-header"
|
|
798
|
-
}, [
|
|
802
|
+
}, [c("div", {
|
|
799
803
|
class: "f-calendar-day-view-header-corner"
|
|
800
|
-
}, null),
|
|
804
|
+
}, null), c("div", {
|
|
801
805
|
class: "f-calendar-day-view-header-primary"
|
|
802
|
-
}, [
|
|
806
|
+
}, [c("div", {
|
|
803
807
|
class: "f-calendar-day-view-header-columns"
|
|
804
|
-
}, [
|
|
808
|
+
}, [c("div", {
|
|
805
809
|
class: "f-calendar-day-view-header-cell"
|
|
806
|
-
}, [
|
|
810
|
+
}, [c("div", {
|
|
807
811
|
class: g(y.value)
|
|
808
|
-
}, [y.value.date.day]),
|
|
812
|
+
}, [y.value.date.day]), c("span", null, [m.value])])])])]);
|
|
809
813
|
}
|
|
810
|
-
function
|
|
811
|
-
return
|
|
814
|
+
function i() {
|
|
815
|
+
return c("div", {
|
|
812
816
|
class: "f-calendar-day-view-content-side"
|
|
813
|
-
}, [
|
|
817
|
+
}, [c("div", {
|
|
814
818
|
class: "f-calendar-side"
|
|
815
|
-
}, [s.value.map((a) =>
|
|
819
|
+
}, [s.value.map((a) => c("div", {
|
|
816
820
|
class: "f-calendar-side-row"
|
|
817
|
-
}, [
|
|
821
|
+
}, [c("div", {
|
|
818
822
|
class: "f-calendar-side-row-number"
|
|
819
823
|
}, [a.part === "upper" ? a.title : ""])]))])]);
|
|
820
824
|
}
|
|
@@ -826,215 +830,222 @@ const Y = /* @__PURE__ */ B({
|
|
|
826
830
|
};
|
|
827
831
|
}
|
|
828
832
|
function h(a) {
|
|
829
|
-
const
|
|
833
|
+
const P = (a.starts.hour || 0) + (a.starts.minute || 0) / 60;
|
|
830
834
|
return {
|
|
831
|
-
height: `${44 * ((a.ends.hour || 0) + (a.ends.minute || 0) / 60 -
|
|
835
|
+
height: `${44 * ((a.ends.hour || 0) + (a.ends.minute || 0) / 60 - P) - 2 - 2 - 1 - 1}px`
|
|
832
836
|
};
|
|
833
837
|
}
|
|
834
838
|
function D() {
|
|
835
|
-
return s.value.map((a) =>
|
|
839
|
+
return s.value.map((a) => c("div", {
|
|
836
840
|
class: f(a)
|
|
837
|
-
}, [a.events.map((r) =>
|
|
841
|
+
}, [a.events.map((r) => c("div", {
|
|
838
842
|
class: "f-calendar-day-view-item-cell"
|
|
839
|
-
}, [r.events.length > 0 && r.events.map((w) =>
|
|
843
|
+
}, [r.events.length > 0 && r.events.map((w) => c("div", {
|
|
840
844
|
class: "f-calendar-event",
|
|
841
845
|
style: h(w)
|
|
842
846
|
}, [w.title]))]))]));
|
|
843
847
|
}
|
|
844
|
-
function
|
|
845
|
-
return
|
|
846
|
-
ref:
|
|
848
|
+
function d() {
|
|
849
|
+
return c("div", {
|
|
850
|
+
ref: l,
|
|
847
851
|
class: "f-calendar-content-primary"
|
|
848
|
-
}, [
|
|
852
|
+
}, [c("div", {
|
|
849
853
|
class: "f-calendar-content-data"
|
|
850
854
|
}, [D()])]);
|
|
851
855
|
}
|
|
852
856
|
return J(() => {
|
|
853
857
|
t.value && t.value.scrollTo(0, 250);
|
|
854
|
-
}), () =>
|
|
858
|
+
}), () => c("div", {
|
|
855
859
|
class: "f-calendar-day-view"
|
|
856
|
-
}, [b(),
|
|
860
|
+
}, [b(), c("div", {
|
|
857
861
|
class: "f-calendar-day-view-content",
|
|
858
862
|
ref: t
|
|
859
|
-
}, [
|
|
863
|
+
}, [i(), d()])]);
|
|
860
864
|
}
|
|
861
|
-
}),
|
|
865
|
+
}), B = /* @__PURE__ */ F({
|
|
862
866
|
name: "FCalendar",
|
|
863
867
|
props: Q,
|
|
864
868
|
emits: [],
|
|
865
869
|
setup(e) {
|
|
866
870
|
const {
|
|
867
871
|
sameDay: t
|
|
868
|
-
} =
|
|
869
|
-
getToday:
|
|
870
|
-
} = z(), m =
|
|
871
|
-
year:
|
|
872
|
-
month:
|
|
873
|
-
day:
|
|
874
|
-
}), s =
|
|
872
|
+
} = H(), {
|
|
873
|
+
getToday: l
|
|
874
|
+
} = z(), m = V(e.firstDayOfTheWeek), y = V(e.events), u = l(), o = V({
|
|
875
|
+
year: u.year || 1,
|
|
876
|
+
month: u.month || 1,
|
|
877
|
+
day: u.day || 1
|
|
878
|
+
}), s = V(3), {
|
|
875
879
|
getMonthlyCalendar: k,
|
|
876
880
|
getWeeklyCalendar: n,
|
|
877
881
|
getPreviousDay: p,
|
|
878
882
|
getNextDay: g,
|
|
879
883
|
getDayInPreviousWeek: b,
|
|
880
|
-
getDayInNextWeek:
|
|
884
|
+
getDayInNextWeek: i,
|
|
881
885
|
getDayInPreviousMonth: f,
|
|
882
886
|
getDayInNextMonth: h
|
|
883
|
-
} = ae(), D =
|
|
884
|
-
const
|
|
885
|
-
return
|
|
886
|
-
}), v =
|
|
887
|
-
function
|
|
888
|
-
s.value =
|
|
887
|
+
} = ae(), D = W(() => `${X[o.value.month || 1]} ${o.value.year}`), d = W(() => k(o.value.month || 1, o.value.year || 1, m.value)), a = W(() => n(o.value.day || 1, o.value.month || 1, o.value.year || 1, m.value)), r = W(() => a.value.days.find((N) => t(N.date, o.value)) || a.value.days[1]), w = W(() => {
|
|
888
|
+
const N = a.value.days.findIndex((j) => t(j.date, o.value)), q = N > -1 ? N : 1;
|
|
889
|
+
return I[q];
|
|
890
|
+
}), v = W(() => s.value === 3), M = W(() => s.value === 2), T = W(() => s.value === 1);
|
|
891
|
+
function P(N) {
|
|
892
|
+
s.value = N;
|
|
889
893
|
}
|
|
890
|
-
function
|
|
891
|
-
|
|
894
|
+
function S(N) {
|
|
895
|
+
N === 1 && (o.value = p(o.value)), N === 2 && (o.value = b(o.value)), N === 3 && (o.value = f(o.value));
|
|
892
896
|
}
|
|
893
|
-
function
|
|
894
|
-
|
|
897
|
+
function C(N) {
|
|
898
|
+
N === 1 && (o.value = g(o.value)), N === 2 && (o.value = i(o.value)), N === 3 && (o.value = h(o.value));
|
|
895
899
|
}
|
|
896
900
|
function E() {
|
|
897
901
|
o.value = {
|
|
898
|
-
year:
|
|
899
|
-
month:
|
|
900
|
-
day:
|
|
902
|
+
year: u.year || 1,
|
|
903
|
+
month: u.month || 1,
|
|
904
|
+
day: u.day || 1
|
|
901
905
|
};
|
|
902
906
|
}
|
|
903
|
-
return () =>
|
|
907
|
+
return () => c("div", {
|
|
904
908
|
class: "f-calendar"
|
|
905
|
-
}, [
|
|
909
|
+
}, [c(_, {
|
|
906
910
|
activeView: s.value,
|
|
907
911
|
title: D.value,
|
|
908
|
-
onViewChange: (
|
|
909
|
-
onPrevious: (
|
|
910
|
-
onNext: (
|
|
912
|
+
onViewChange: (N) => P(N),
|
|
913
|
+
onPrevious: (N) => S(N),
|
|
914
|
+
onNext: (N) => C(N),
|
|
911
915
|
onResetToToday: () => E()
|
|
912
|
-
}, null),
|
|
916
|
+
}, null), c("div", null, [T.value && c(L, {
|
|
913
917
|
day: r.value,
|
|
914
918
|
dayInWeek: w.value,
|
|
915
919
|
events: y.value
|
|
916
|
-
}, null),
|
|
920
|
+
}, null), M.value && c(Y, {
|
|
917
921
|
week: a.value,
|
|
918
922
|
events: y.value
|
|
919
|
-
}, null), v.value &&
|
|
923
|
+
}, null), v.value && c(x, {
|
|
920
924
|
activeDay: o.value,
|
|
921
|
-
dates:
|
|
925
|
+
dates: d.value,
|
|
922
926
|
events: y.value
|
|
923
927
|
}, null)])]);
|
|
924
928
|
}
|
|
925
929
|
});
|
|
926
|
-
function
|
|
930
|
+
function Fe(e, t, l) {
|
|
927
931
|
var w;
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
const y = "", d = "", o = M();
|
|
931
|
-
function s() {
|
|
932
|
+
const m = "", y = "", u = V();
|
|
933
|
+
function o() {
|
|
932
934
|
return (t == null ? void 0 : t.schema.componentType) !== "frame";
|
|
933
935
|
}
|
|
934
|
-
function
|
|
936
|
+
function s() {
|
|
935
937
|
return !1;
|
|
936
938
|
}
|
|
937
|
-
function
|
|
939
|
+
function k() {
|
|
938
940
|
return (t == null ? void 0 : t.schema.componentType) !== "frame";
|
|
939
941
|
}
|
|
940
|
-
function
|
|
942
|
+
function n() {
|
|
941
943
|
return (t == null ? void 0 : t.schema.componentType) === "frame";
|
|
942
944
|
}
|
|
943
|
-
function
|
|
945
|
+
function p(v) {
|
|
944
946
|
if (!v || !v.value)
|
|
945
947
|
return null;
|
|
946
948
|
if (v.value.schema && v.value.schema.type === "component")
|
|
947
949
|
return v.value;
|
|
948
|
-
const
|
|
949
|
-
return
|
|
950
|
+
const M = V(v == null ? void 0 : v.value.parent), T = p(M);
|
|
951
|
+
return T || null;
|
|
950
952
|
}
|
|
951
|
-
function
|
|
952
|
-
const { componentInstance:
|
|
953
|
-
return !
|
|
953
|
+
function g(v = t) {
|
|
954
|
+
const { componentInstance: M, designerItemElementRef: T } = v;
|
|
955
|
+
return !M || !M.value ? null : M.value.canMove ? T : g(v.parent);
|
|
954
956
|
}
|
|
955
|
-
function
|
|
956
|
-
return !!
|
|
957
|
+
function b(v) {
|
|
958
|
+
return !!l;
|
|
957
959
|
}
|
|
958
|
-
function
|
|
960
|
+
function i() {
|
|
959
961
|
return (t == null ? void 0 : t.schema.label) || (t == null ? void 0 : t.schema.title) || (t == null ? void 0 : t.schema.name);
|
|
960
962
|
}
|
|
961
|
-
function
|
|
963
|
+
function f() {
|
|
964
|
+
}
|
|
965
|
+
function h(v, M) {
|
|
962
966
|
}
|
|
963
|
-
function D(v,
|
|
967
|
+
function D(v, M) {
|
|
968
|
+
const { componentType: T } = v;
|
|
969
|
+
let P = ne(T, v, M);
|
|
970
|
+
const S = T.toLowerCase().replace(/-/g, "_");
|
|
971
|
+
return P && !P.id && P.type === T && (P.id = `${S}_${Math.random().toString().slice(2, 6)}`), P;
|
|
964
972
|
}
|
|
965
|
-
function
|
|
966
|
-
const { componentType: V } = v;
|
|
967
|
-
let C = ne(V, v, T);
|
|
968
|
-
const j = V.toLowerCase().replace("-", "_");
|
|
969
|
-
return C && !C.id && C.type === V && (C.id = `${j}_${Math.random().toString().slice(2, 6)}`), C;
|
|
973
|
+
function d(v) {
|
|
970
974
|
}
|
|
971
|
-
function a(v) {
|
|
975
|
+
function a(...v) {
|
|
972
976
|
}
|
|
973
|
-
function r(
|
|
977
|
+
function r() {
|
|
978
|
+
t != null && t.schema.contents && t.schema.contents.map((v) => {
|
|
979
|
+
var P;
|
|
980
|
+
let M = v.id;
|
|
981
|
+
v.type === "component-ref" && (M = v.component);
|
|
982
|
+
const T = e.value.querySelector(`#${M}-design-item`);
|
|
983
|
+
(P = T == null ? void 0 : T.componentInstance) != null && P.value.onRemoveComponent && T.componentInstance.value.onRemoveComponent();
|
|
984
|
+
});
|
|
974
985
|
}
|
|
975
|
-
return
|
|
976
|
-
canMove:
|
|
977
|
-
canSelectParent:
|
|
978
|
-
canDelete:
|
|
979
|
-
canNested: !
|
|
986
|
+
return u.value = {
|
|
987
|
+
canMove: o(),
|
|
988
|
+
canSelectParent: s(),
|
|
989
|
+
canDelete: k(),
|
|
990
|
+
canNested: !n(),
|
|
980
991
|
contents: t == null ? void 0 : t.schema.contents,
|
|
981
992
|
elementRef: e,
|
|
982
993
|
parent: (w = t == null ? void 0 : t.parent) == null ? void 0 : w.componentInstance,
|
|
983
994
|
schema: t == null ? void 0 : t.schema,
|
|
984
|
-
styles:
|
|
985
|
-
designerClass:
|
|
986
|
-
canAccepts:
|
|
987
|
-
getBelongedComponentInstance:
|
|
988
|
-
getDraggableDesignItemElement:
|
|
989
|
-
getDraggingDisplayText:
|
|
990
|
-
getPropConfig:
|
|
991
|
-
getDragScopeElement:
|
|
992
|
-
onAcceptMovedChildElement:
|
|
993
|
-
onChildElementMovedOut:
|
|
994
|
-
addNewChildComponentSchema:
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
},
|
|
995
|
+
styles: m,
|
|
996
|
+
designerClass: y,
|
|
997
|
+
canAccepts: b,
|
|
998
|
+
getBelongedComponentInstance: p,
|
|
999
|
+
getDraggableDesignItemElement: g,
|
|
1000
|
+
getDraggingDisplayText: i,
|
|
1001
|
+
getPropConfig: a,
|
|
1002
|
+
getDragScopeElement: f,
|
|
1003
|
+
onAcceptMovedChildElement: h,
|
|
1004
|
+
onChildElementMovedOut: d,
|
|
1005
|
+
addNewChildComponentSchema: D,
|
|
1006
|
+
triggerBelongedComponentToMoveWhenMoved: V(!1),
|
|
1007
|
+
triggerBelongedComponentToDeleteWhenDeleted: V(!1),
|
|
1008
|
+
onRemoveComponent: r
|
|
1009
|
+
}, u;
|
|
999
1010
|
}
|
|
1000
|
-
const
|
|
1011
|
+
const Ie = /* @__PURE__ */ F({
|
|
1001
1012
|
name: "FCalendarDesign",
|
|
1002
1013
|
props: Q,
|
|
1003
1014
|
emits: [],
|
|
1004
1015
|
setup(e, t) {
|
|
1005
1016
|
const {
|
|
1006
|
-
sameDay:
|
|
1007
|
-
} =
|
|
1017
|
+
sameDay: l
|
|
1018
|
+
} = H(), {
|
|
1008
1019
|
getToday: m
|
|
1009
|
-
} = z(), y =
|
|
1020
|
+
} = z(), y = V(e.firstDayOfTheWeek), u = V(e.events), o = m(), s = V({
|
|
1010
1021
|
year: o.year || 1,
|
|
1011
1022
|
month: o.month || 1,
|
|
1012
1023
|
day: o.day || 1
|
|
1013
|
-
}), k =
|
|
1024
|
+
}), k = V(3), n = V(), p = se("design-item-context"), g = Fe(n, p);
|
|
1014
1025
|
J(() => {
|
|
1015
1026
|
n.value.componentInstance = g;
|
|
1016
1027
|
}), t.expose(g.value);
|
|
1017
1028
|
const {
|
|
1018
1029
|
getMonthlyCalendar: b,
|
|
1019
|
-
getWeeklyCalendar:
|
|
1030
|
+
getWeeklyCalendar: i,
|
|
1020
1031
|
getPreviousDay: f,
|
|
1021
1032
|
getNextDay: h,
|
|
1022
1033
|
getDayInPreviousWeek: D,
|
|
1023
|
-
getDayInNextWeek:
|
|
1034
|
+
getDayInNextWeek: d,
|
|
1024
1035
|
getDayInPreviousMonth: a,
|
|
1025
1036
|
getDayInNextMonth: r
|
|
1026
|
-
} = ae(), w =
|
|
1027
|
-
const
|
|
1028
|
-
return
|
|
1029
|
-
}),
|
|
1030
|
-
function
|
|
1031
|
-
k.value =
|
|
1037
|
+
} = ae(), w = W(() => `${X[s.value.month || 1]} ${s.value.year}`), v = W(() => b(s.value.month || 1, s.value.year || 1, y.value)), M = W(() => i(s.value.day || 1, s.value.month || 1, s.value.year || 1, y.value)), T = W(() => M.value.days.find((O) => l(O.date, s.value)) || M.value.days[1]), P = W(() => {
|
|
1038
|
+
const O = M.value.days.findIndex((oe) => l(oe.date, s.value)), re = O > -1 ? O : 1;
|
|
1039
|
+
return I[re];
|
|
1040
|
+
}), S = W(() => k.value === 3), C = W(() => k.value === 2), E = W(() => k.value === 1);
|
|
1041
|
+
function N(O) {
|
|
1042
|
+
k.value = O;
|
|
1032
1043
|
}
|
|
1033
|
-
function
|
|
1034
|
-
|
|
1044
|
+
function q(O) {
|
|
1045
|
+
O === 1 && (s.value = f(s.value)), O === 2 && (s.value = D(s.value)), O === 3 && (s.value = a(s.value));
|
|
1035
1046
|
}
|
|
1036
|
-
function
|
|
1037
|
-
|
|
1047
|
+
function j(O) {
|
|
1048
|
+
O === 1 && (s.value = h(s.value)), O === 2 && (s.value = d(s.value)), O === 3 && (s.value = r(s.value));
|
|
1038
1049
|
}
|
|
1039
1050
|
function R() {
|
|
1040
1051
|
s.value = {
|
|
@@ -1043,53 +1054,53 @@ const Fe = /* @__PURE__ */ B({
|
|
|
1043
1054
|
day: o.day || 1
|
|
1044
1055
|
};
|
|
1045
1056
|
}
|
|
1046
|
-
return () =>
|
|
1057
|
+
return () => c("div", {
|
|
1047
1058
|
ref: n,
|
|
1048
1059
|
class: "f-calendar"
|
|
1049
|
-
}, [
|
|
1060
|
+
}, [c(_, {
|
|
1050
1061
|
activeView: k.value,
|
|
1051
1062
|
title: w.value,
|
|
1052
|
-
onViewChange: (
|
|
1053
|
-
onPrevious: (
|
|
1054
|
-
onNext: (
|
|
1063
|
+
onViewChange: (O) => N(O),
|
|
1064
|
+
onPrevious: (O) => q(O),
|
|
1065
|
+
onNext: (O) => j(O),
|
|
1055
1066
|
onResetToToday: () => R()
|
|
1056
|
-
}, null),
|
|
1057
|
-
day:
|
|
1058
|
-
dayInWeek:
|
|
1059
|
-
events:
|
|
1060
|
-
}, null),
|
|
1061
|
-
week:
|
|
1062
|
-
events:
|
|
1063
|
-
}, null),
|
|
1067
|
+
}, null), c("div", null, [E.value && c(L, {
|
|
1068
|
+
day: T.value,
|
|
1069
|
+
dayInWeek: P.value,
|
|
1070
|
+
events: u.value
|
|
1071
|
+
}, null), C.value && c(Y, {
|
|
1072
|
+
week: M.value,
|
|
1073
|
+
events: u.value
|
|
1074
|
+
}, null), S.value && c(x, {
|
|
1064
1075
|
activeDay: s.value,
|
|
1065
1076
|
dates: v.value,
|
|
1066
|
-
events:
|
|
1077
|
+
events: u.value
|
|
1067
1078
|
}, null)])]);
|
|
1068
1079
|
}
|
|
1069
1080
|
});
|
|
1070
|
-
|
|
1071
|
-
e.component(
|
|
1081
|
+
B.install = (e) => {
|
|
1082
|
+
e.component(B.name, B).component(L.name, L).component(_.name, _).component(x.name, x).component(Y.name, Y);
|
|
1072
1083
|
};
|
|
1073
|
-
|
|
1074
|
-
e.calendar =
|
|
1084
|
+
B.register = (e, t, l, m) => {
|
|
1085
|
+
e.calendar = B, t.calendar = te;
|
|
1075
1086
|
};
|
|
1076
|
-
|
|
1077
|
-
e.calendar =
|
|
1087
|
+
B.registerDesigner = (e, t, l) => {
|
|
1088
|
+
e.calendar = Ie, t.calendar = te;
|
|
1078
1089
|
};
|
|
1079
1090
|
export {
|
|
1080
|
-
|
|
1091
|
+
B as FCalendar,
|
|
1081
1092
|
L as FCalendarDayView,
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1093
|
+
_ as FCalendarHeader,
|
|
1094
|
+
x as FCalendarMonthView,
|
|
1095
|
+
Y as FCalendarWeekView,
|
|
1096
|
+
A as MonthTag,
|
|
1086
1097
|
Q as calendarProps,
|
|
1087
|
-
|
|
1088
|
-
|
|
1098
|
+
Be as dayViewProps,
|
|
1099
|
+
B as default,
|
|
1089
1100
|
X as defaultNameOfMonths,
|
|
1090
|
-
|
|
1091
|
-
|
|
1101
|
+
je as headerProps,
|
|
1102
|
+
Ae as monthViewProps,
|
|
1092
1103
|
te as propsResolver,
|
|
1093
|
-
|
|
1094
|
-
|
|
1104
|
+
I as weekDays,
|
|
1105
|
+
$e as weekViewProps
|
|
1095
1106
|
};
|