vft 0.0.72 → 0.0.73
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, ref as o, computed as q, createVNode as e, withDirectives as F, resolveDirective as T, Fragment as z } from "vue";
|
|
2
2
|
import { useNamespace as B } from "../../hooks/use-namespace/index.js";
|
|
3
3
|
import "@popperjs/core";
|
|
4
4
|
import "lodash";
|
|
5
5
|
import "../../hooks/use-z-index/index.js";
|
|
6
6
|
import "@vueuse/core";
|
|
7
|
-
import { isArray as
|
|
7
|
+
import { isArray as b } from "@vft/utils";
|
|
8
8
|
import "../../utils/ns-cover.js";
|
|
9
9
|
import v from "dayjs";
|
|
10
10
|
import { VftIcon as w } from "../icon/index.js";
|
|
@@ -13,9 +13,9 @@ import G from "../date-picker/index.js";
|
|
|
13
13
|
const n = (
|
|
14
14
|
/* hoist-static*/
|
|
15
15
|
B("date-time-select")
|
|
16
|
-
), J =
|
|
16
|
+
), J = x({
|
|
17
17
|
name: n.b()
|
|
18
|
-
}),
|
|
18
|
+
}), re = /* @__PURE__ */ x({
|
|
19
19
|
...J,
|
|
20
20
|
props: {
|
|
21
21
|
dateList: {
|
|
@@ -27,90 +27,88 @@ const n = (
|
|
|
27
27
|
},
|
|
28
28
|
emits: ["change"],
|
|
29
29
|
setup(f, {
|
|
30
|
-
emit:
|
|
30
|
+
emit: H
|
|
31
31
|
}) {
|
|
32
|
-
const k = o(!1), D = o(),
|
|
33
|
-
function
|
|
32
|
+
const k = o(!1), D = o(), I = o("请选择时间"), t = o("");
|
|
33
|
+
function M(a) {
|
|
34
34
|
const {
|
|
35
35
|
count: l,
|
|
36
36
|
type: g,
|
|
37
|
-
format:
|
|
38
|
-
dateRange:
|
|
37
|
+
format: d,
|
|
38
|
+
dateRange: s = !0,
|
|
39
39
|
startOfType: O,
|
|
40
|
-
endOfType:
|
|
40
|
+
endOfType: V
|
|
41
41
|
} = a;
|
|
42
|
-
let m, r,
|
|
43
|
-
const p =
|
|
44
|
-
let
|
|
45
|
-
const
|
|
46
|
-
let h,
|
|
47
|
-
return
|
|
42
|
+
let m, r, L;
|
|
43
|
+
const p = d || f.defaultFormat;
|
|
44
|
+
let i = v().format(p);
|
|
45
|
+
const R = (u, S = !0) => {
|
|
46
|
+
let h, Y = S ? "startOf" : "endOf";
|
|
47
|
+
return u === "week" ? h = v().add(l, u)[Y](u).add(1, "day").format(p) : h = v().add(l, u)[Y](u).format(p), h;
|
|
48
48
|
};
|
|
49
|
-
O && (m =
|
|
50
|
-
let
|
|
51
|
-
return
|
|
49
|
+
O && (m = R(O)), V && (r = R(V, !1)), L = v().add(l, g).format(p);
|
|
50
|
+
let c = m || r || L;
|
|
51
|
+
return s ? m && r ? [c, r] : l > 0 ? [c !== r && r || i, c] : l === 0 ? [m || i, r || i] : [c, c !== r && r || i] : c;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
D.value = a,
|
|
53
|
+
function N(a, l) {
|
|
54
|
+
D.value = a, y.value.handleClose(), t.value = M(l), H("change", t.value);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function P() {
|
|
57
57
|
t.value = "";
|
|
58
58
|
}
|
|
59
59
|
const C = q(() => {
|
|
60
60
|
var a;
|
|
61
|
-
return
|
|
62
|
-
}),
|
|
63
|
-
function
|
|
61
|
+
return b(t.value) && ((a = t.value) != null && a.length) ? t.value[0] + " - " + t.value[1] : t.value;
|
|
62
|
+
}), y = o();
|
|
63
|
+
function j(a) {
|
|
64
64
|
k.value = a;
|
|
65
65
|
}
|
|
66
|
-
o([new Date(2e3, 10, 10, 10, 10), new Date(2e3, 10, 11, 10, 10)]);
|
|
67
|
-
const
|
|
68
|
-
const a =
|
|
66
|
+
o([new Date(2e3, 10, 10, 10, 10), new Date(2e3, 10, 11, 10, 10)]), o();
|
|
67
|
+
const A = () => {
|
|
68
|
+
const a = b(f.dateList[0]) ? f.dateList : [f.dateList];
|
|
69
69
|
return e("div", {
|
|
70
70
|
class: n.e("content")
|
|
71
71
|
}, [e(z, null, [a.map((l, g) => e("div", {
|
|
72
72
|
key: g,
|
|
73
73
|
class: n.e("item-container")
|
|
74
|
-
}, [l.map((
|
|
75
|
-
class: [n.e("item"), n.is("active", D.value ===
|
|
76
|
-
onClick: () =>
|
|
74
|
+
}, [l.map((d, s) => e("div", {
|
|
75
|
+
class: [n.e("item"), n.is("active", D.value === s)],
|
|
76
|
+
onClick: () => N(s, d)
|
|
77
77
|
}, [e("span", {
|
|
78
|
-
key:
|
|
79
|
-
}, [
|
|
78
|
+
key: s
|
|
79
|
+
}, [d.text]), D.value === s ? e(w, {
|
|
80
80
|
icon: "ico-ep:check"
|
|
81
81
|
}, null) : null])), e(G, {
|
|
82
82
|
teleported: !1,
|
|
83
|
-
modelValue: y,
|
|
84
|
-
"onUpdate:modelValue": (s) => y = s,
|
|
85
83
|
type: "datetime",
|
|
86
84
|
placeholder: "Select date and time"
|
|
87
85
|
}, null)]))])]);
|
|
88
86
|
};
|
|
89
87
|
return () => e(E, {
|
|
90
|
-
ref:
|
|
88
|
+
ref: y,
|
|
91
89
|
trigger: "click",
|
|
92
90
|
teleported: !1,
|
|
93
91
|
class: n.b(),
|
|
94
|
-
onVisibleChange:
|
|
92
|
+
onVisibleChange: j
|
|
95
93
|
}, {
|
|
96
94
|
default: () => [e("span", {
|
|
97
95
|
class: [n.e("trigger"), "cursor-pointer"]
|
|
98
96
|
}, [e("span", {
|
|
99
97
|
class: [C.value ? "text" : "placeholder"]
|
|
100
|
-
}, [C.value ||
|
|
101
|
-
onClick:
|
|
98
|
+
}, [C.value || I.value]), F(e(w, {
|
|
99
|
+
onClick: P,
|
|
102
100
|
icon: "ico-ep:circle-close",
|
|
103
101
|
class: "hover:text-black"
|
|
104
|
-
}, null), [[
|
|
102
|
+
}, null), [[T("if"), t.value]]), F(e(w, {
|
|
105
103
|
icon: "ico-ep:arrow-down",
|
|
106
104
|
class: [{
|
|
107
105
|
"rotate-180": k.value
|
|
108
106
|
}]
|
|
109
|
-
}, null), [[
|
|
110
|
-
dropdown: () =>
|
|
107
|
+
}, null), [[T("if"), t.value]])])],
|
|
108
|
+
dropdown: () => A()
|
|
111
109
|
});
|
|
112
110
|
}
|
|
113
111
|
});
|
|
114
112
|
export {
|
|
115
|
-
|
|
113
|
+
re as default
|
|
116
114
|
};
|
package/es/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),S=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");require("lodash");require("../../hooks/use-z-index/index.cjs");require("@vueuse/core");const x=require("@vft/utils");require("../../utils/ns-cover.cjs");const m=require("dayjs"),g=require("../icon/index.cjs"),$=require("../dropdown/index.cjs"),j=require("../date-picker/index.cjs"),l=S.useNamespace("date-time-select"),A=e.defineComponent({name:l.b()}),H=e.defineComponent({...A,props:{dateList:{default:[]},defaultFormat:{default:"YYYY-MM-DD HH:mm:ss"}},emits:["change"],setup(u,{emit:b}){const h=e.ref(!1),p=e.ref(),I=e.ref("请选择时间"),t=e.ref("");function L(a){const{count:r,type:V,format:d,dateRange:o=!0,startOfType:w,endOfType:C}=a;let f,n,k;const v=d||u.defaultFormat;let c=m().format(v);const y=(i,F=!0)=>{let D,O=F?"startOf":"endOf";return i==="week"?D=m().add(r,i)[O](i).add(1,"day").format(v):D=m().add(r,i)[O](i).format(v),D};w&&(f=y(w)),C&&(n=y(C,!1)),k=m().add(r,V).format(v);let s=f||n||k;return o?f&&n?[s,n]:r>0?[s!==n&&n||c,s]:r===0?[f||c,n||c]:[s,s!==n&&n||c]:s}function M(a,r){p.value=a,q.value.handleClose(),t.value=L(r),b("change",t.value)}function R(){t.value=""}const N=e.computed(()=>{var a;return x.isArray(t.value)&&((a=t.value)!=null&&a.length)?t.value[0]+" - "+t.value[1]:t.value}),q=e.ref();function T(a){h.value=a}e.ref([new Date(2e3,10,10,10,10),new Date(2e3,10,11,10,10)]),e.ref();const Y=()=>{const a=x.isArray(u.dateList[0])?u.dateList:[u.dateList];return e.createVNode("div",{class:l.e("content")},[e.createVNode(e.Fragment,null,[a.map((r,V)=>e.createVNode("div",{key:V,class:l.e("item-container")},[r.map((d,o)=>e.createVNode("div",{class:[l.e("item"),l.is("active",p.value===o)],onClick:()=>M(o,d)},[e.createVNode("span",{key:o},[d.text]),p.value===o?e.createVNode(g.VftIcon,{icon:"ico-ep:check"},null):null])),e.createVNode(j.default,{teleported:!1,type:"datetime",placeholder:"Select date and time"},null)]))])])};return()=>e.createVNode($.VftDropdown,{ref:q,trigger:"click",teleported:!1,class:l.b(),onVisibleChange:T},{default:()=>[e.createVNode("span",{class:[l.e("trigger"),"cursor-pointer"]},[e.createVNode("span",{class:[N.value?"text":"placeholder"]},[N.value||I.value]),e.withDirectives(e.createVNode(g.VftIcon,{onClick:R,icon:"ico-ep:circle-close",class:"hover:text-black"},null),[[e.resolveDirective("if"),t.value]]),e.withDirectives(e.createVNode(g.VftIcon,{icon:"ico-ep:arrow-down",class:[{"rotate-180":h.value}]},null),[[e.resolveDirective("if"),t.value]])])],dropdown:()=>Y()})}});exports.default=H;
|
package/lib/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.73";exports.version=e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"qrcode": "1.5.1",
|
|
54
54
|
"resize-detector": "0.3.0",
|
|
55
55
|
"sortablejs": "^1.15.0",
|
|
56
|
-
"@vft/constants": "0.0.
|
|
57
|
-
"@vft/
|
|
58
|
-
"@vft/
|
|
59
|
-
"@vft/use": "0.0.
|
|
60
|
-
"@vft/utils": "0.0.
|
|
61
|
-
"@vft/directives": "0.0.
|
|
56
|
+
"@vft/constants": "0.0.47",
|
|
57
|
+
"@vft/router": "0.0.18",
|
|
58
|
+
"@vft/store": "0.0.19",
|
|
59
|
+
"@vft/use": "0.0.21",
|
|
60
|
+
"@vft/utils": "0.0.31",
|
|
61
|
+
"@vft/directives": "0.0.15"
|
|
62
62
|
},
|
|
63
63
|
"vetur": {
|
|
64
64
|
"tags": "tags.json",
|