vft 0.0.391 → 0.0.394
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/es/components/date-picker/date-picker.js +8 -8
- package/es/components/super-form/use/use-auto-focus.js +5 -5
- package/es/components/super-form/use/use-form-events.js +19 -19
- package/es/components/time-picker/time-picker.js +1 -1
- package/es/components/time-select/time-select.vue2.js +1 -1
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/date-picker/date-picker.cjs +1 -1
- package/lib/components/super-form/use/use-auto-focus.cjs +1 -1
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/time-picker/time-picker.cjs +1 -1
- package/lib/components/time-select/time-select.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +4 -4
- package/web-types.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent as O, computed as _, provide as a, reactive as s, toRef as P, ref as T, createVNode as n, mergeProps as x } from "vue";
|
|
2
2
|
import e from "dayjs";
|
|
3
|
-
import I from "dayjs/plugin/customParseFormat
|
|
4
|
-
import v from "dayjs/plugin/advancedFormat
|
|
5
|
-
import C from "dayjs/plugin/localeData
|
|
6
|
-
import D from "dayjs/plugin/weekOfYear
|
|
7
|
-
import N from "dayjs/plugin/weekYear
|
|
8
|
-
import R from "dayjs/plugin/dayOfYear
|
|
9
|
-
import y from "dayjs/plugin/isSameOrAfter
|
|
10
|
-
import A from "dayjs/plugin/isSameOrBefore
|
|
3
|
+
import I from "dayjs/plugin/customParseFormat";
|
|
4
|
+
import v from "dayjs/plugin/advancedFormat";
|
|
5
|
+
import C from "dayjs/plugin/localeData";
|
|
6
|
+
import D from "dayjs/plugin/weekOfYear";
|
|
7
|
+
import N from "dayjs/plugin/weekYear";
|
|
8
|
+
import R from "dayjs/plugin/dayOfYear";
|
|
9
|
+
import y from "dayjs/plugin/isSameOrAfter";
|
|
10
|
+
import A from "dayjs/plugin/isSameOrBefore";
|
|
11
11
|
import "@vueuse/core";
|
|
12
12
|
import "@vft/utils";
|
|
13
13
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FormCompEnum as p } from "../../../utils/form-register.js";
|
|
1
|
+
import { FormCompEnum as m } from "../../../utils/form-register.js";
|
|
3
2
|
import "@vueuse/core";
|
|
4
3
|
import "@vft/utils";
|
|
5
4
|
import "../../config-provider/hooks/use-global-config.js";
|
|
5
|
+
import { watchEffect as u, unref as t, nextTick as p } from "vue";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
async function w({
|
|
8
8
|
getSchema: n,
|
|
@@ -10,12 +10,12 @@ async function w({
|
|
|
10
10
|
formElRef: s,
|
|
11
11
|
isInitedDefault: f
|
|
12
12
|
}) {
|
|
13
|
-
|
|
13
|
+
u(async () => {
|
|
14
14
|
if (t(f) || !t(c).autoFocusFirstItem)
|
|
15
15
|
return;
|
|
16
|
-
await
|
|
16
|
+
await p();
|
|
17
17
|
const r = t(n), o = t(s), e = o?.$el;
|
|
18
|
-
if (!o || !e || !r || r.length === 0 || r[0].type !==
|
|
18
|
+
if (!o || !e || !r || r.length === 0 || r[0].type !== m.INPUT)
|
|
19
19
|
return;
|
|
20
20
|
const i = e.querySelector(
|
|
21
21
|
".vft-row:first-child input"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { formatToDate as Q } from "@vft/utils/date";
|
|
3
|
-
import { get as ot, cloneDeep as I, uniqBy as at, isEqual as ft, set as X } from "lodash-es";
|
|
4
|
-
import { unref as n, toRaw as x, nextTick as W } from "vue";
|
|
5
|
-
import { FormCompEnum as S } from "../../../utils/form-register.js";
|
|
1
|
+
import { FormCompEnum as j } from "../../../utils/form-register.js";
|
|
6
2
|
import "@vueuse/core";
|
|
3
|
+
import { isDef as H, isFunction as A, isString as x, isObject as V, isArray as m, deepMerge as nt, findDifferentValuesForObj as rt, isNullOrUndefined as J, isEmpty as st, isEmptyObject as lt } from "@vft/utils";
|
|
7
4
|
import "../../config-provider/hooks/use-global-config.js";
|
|
5
|
+
import { unref as n, toRaw as S, nextTick as Q } from "vue";
|
|
6
|
+
import { get as ot, cloneDeep as I, uniqBy as at, isEqual as ft, set as X } from "lodash-es";
|
|
7
|
+
import { formatToDate as W } from "@vft/utils/date";
|
|
8
8
|
import { isInput as ct, isDatePicker as ut } from "../component-map.js";
|
|
9
9
|
import { handleInputNumberValue as dt } from "./helper.js";
|
|
10
10
|
function _(p, y) {
|
|
@@ -69,7 +69,7 @@ function It({
|
|
|
69
69
|
}) {
|
|
70
70
|
async function Y(t) {
|
|
71
71
|
const { resetFunc: e, submitOnReset: s } = n(y);
|
|
72
|
-
e &&
|
|
72
|
+
e && A(e) && await e();
|
|
73
73
|
const r = n(c);
|
|
74
74
|
if (r) {
|
|
75
75
|
if (t?.length)
|
|
@@ -77,7 +77,7 @@ function It({
|
|
|
77
77
|
Object.keys(o).forEach((a) => {
|
|
78
78
|
const l = n(f).find((u) => u.field === a), i = I(h.value[a]);
|
|
79
79
|
o[a] = ct(l?.type) ? i || "" : i;
|
|
80
|
-
}),
|
|
80
|
+
}), Q(() => D()), p("reset", S(o)), s && await U();
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
async function q(t, e = !0) {
|
|
@@ -99,10 +99,10 @@ function It({
|
|
|
99
99
|
if (Array.isArray(d)) {
|
|
100
100
|
const v = [];
|
|
101
101
|
for (const E of d)
|
|
102
|
-
v.push(E ?
|
|
102
|
+
v.push(E ? W(E) : null);
|
|
103
103
|
n(o)[i] = v;
|
|
104
104
|
} else
|
|
105
|
-
n(o)[i] = d ? w?.valueFormat ? d :
|
|
105
|
+
n(o)[i] = d ? w?.valueFormat ? d : W(d) : null;
|
|
106
106
|
else
|
|
107
107
|
n(o)[i] = d;
|
|
108
108
|
w?.onChange && w?.onChange(d), l.push(i);
|
|
@@ -117,7 +117,7 @@ function It({
|
|
|
117
117
|
));
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
|
-
}), e &&
|
|
120
|
+
}), e && Q(async () => {
|
|
121
121
|
await $(l).catch((i) => {
|
|
122
122
|
});
|
|
123
123
|
});
|
|
@@ -126,14 +126,14 @@ function It({
|
|
|
126
126
|
const e = I(n(f));
|
|
127
127
|
if (!t)
|
|
128
128
|
return;
|
|
129
|
-
let s =
|
|
130
|
-
|
|
129
|
+
let s = x(t) ? [t] : t;
|
|
130
|
+
x(t) && (s = [t]);
|
|
131
131
|
for (const r of s)
|
|
132
132
|
L(r, e);
|
|
133
133
|
F.value = e;
|
|
134
134
|
}
|
|
135
135
|
function L(t, e) {
|
|
136
|
-
if (
|
|
136
|
+
if (x(t)) {
|
|
137
137
|
const s = e.findIndex((r) => r.field === t);
|
|
138
138
|
s !== -1 && (delete o[t], e.splice(s, 1));
|
|
139
139
|
}
|
|
@@ -149,7 +149,7 @@ function It({
|
|
|
149
149
|
async function R(t) {
|
|
150
150
|
let e = [];
|
|
151
151
|
if (V(t) && e.push(t), m(t) && (e = [...t]), !e.every(
|
|
152
|
-
(r) => r.type ===
|
|
152
|
+
(r) => r.type === j.DIVIDER || Reflect.has(r, "field") && r.field
|
|
153
153
|
)) {
|
|
154
154
|
console.error(
|
|
155
155
|
"All children of the form Schema array that need to be updated must contain the `field` field"
|
|
@@ -161,7 +161,7 @@ function It({
|
|
|
161
161
|
async function N(t) {
|
|
162
162
|
let e = [];
|
|
163
163
|
if (V(t) && e.push(t), m(t) && (e = [...t]), !e.every(
|
|
164
|
-
(l) => l.type ===
|
|
164
|
+
(l) => l.type === j.DIVIDER || Reflect.has(l, "field") && l.field
|
|
165
165
|
)) {
|
|
166
166
|
console.error(
|
|
167
167
|
"All children of the form Schema array that need to be updated must contain the `field` field"
|
|
@@ -187,12 +187,12 @@ function It({
|
|
|
187
187
|
V(t) && r.push(t), m(t) && (r = [...t]);
|
|
188
188
|
const a = {}, l = g();
|
|
189
189
|
r.forEach((i) => {
|
|
190
|
-
i.type !==
|
|
190
|
+
i.type !== j.DIVIDER && Reflect.has(i, "field") && i.field && !J(i.defaultValue) && (!(i.field in l) || J(l[i.field]) || st(l[i.field])) && (a[i.field] = i.defaultValue);
|
|
191
191
|
}), lt(a) || q(a, s);
|
|
192
192
|
}
|
|
193
193
|
function g(t = !1) {
|
|
194
194
|
if (!n(c)) return {};
|
|
195
|
-
const s = B(
|
|
195
|
+
const s = B(S(n(o)));
|
|
196
196
|
if (t)
|
|
197
197
|
return s;
|
|
198
198
|
const r = n(f).filter((l) => _(l, n(o))).map((l) => l.field).filter(Boolean), a = {};
|
|
@@ -201,7 +201,7 @@ function It({
|
|
|
201
201
|
}), a;
|
|
202
202
|
}
|
|
203
203
|
function k(t) {
|
|
204
|
-
return n(c) ?
|
|
204
|
+
return n(c) ? S(n(o))[t] : {};
|
|
205
205
|
}
|
|
206
206
|
function M(t) {
|
|
207
207
|
return n(f).some((e) => e.field === t ? ut(e.type) : !1);
|
|
@@ -226,7 +226,7 @@ function It({
|
|
|
226
226
|
const { autoCleanErrorMessage: e, watchDataIsChange: s } = n(y);
|
|
227
227
|
t && t.preventDefault(), e && await D();
|
|
228
228
|
const { submitFunc: r, beforeSubmitFunc: a } = n(y);
|
|
229
|
-
if (a &&
|
|
229
|
+
if (a && A(a) && await a(), r && A(r)) {
|
|
230
230
|
await r();
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as s, ref as p, provide as u, createVNode as t, mergeProps as c } from "vue";
|
|
2
2
|
import d from "dayjs";
|
|
3
|
-
import P from "dayjs/plugin/customParseFormat
|
|
3
|
+
import P from "dayjs/plugin/customParseFormat";
|
|
4
4
|
import { UPDATE_MODEL_EVENT as a } from "../../constants/event.js";
|
|
5
5
|
import { PICKER_POPPER_OPTIONS_INJECTION_KEY as _, DEFAULT_FORMATS_TIME as E } from "./constants.js";
|
|
6
6
|
import O from "./common/picker.vue2.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as v, ref as S, computed as r, createBlock as u, openBlock as s, unref as n, withCtx as f, createElementBlock as h, Fragment as w, renderList as E, createCommentVNode as H, normalizeClass as N } from "vue";
|
|
2
2
|
import d from "dayjs";
|
|
3
|
-
import O from "dayjs/plugin/customParseFormat
|
|
3
|
+
import O from "dayjs/plugin/customParseFormat";
|
|
4
4
|
import b from "../select/index.js";
|
|
5
5
|
import "../form/index.js";
|
|
6
6
|
import { VftIcon as P } from "../icon/index.js";
|
package/es/package.json.d.ts
CHANGED
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"),r=require("dayjs"),E=require("dayjs/plugin/customParseFormat
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("dayjs"),E=require("dayjs/plugin/customParseFormat"),O=require("dayjs/plugin/advancedFormat"),P=require("dayjs/plugin/localeData"),f=require("dayjs/plugin/weekOfYear"),v=require("dayjs/plugin/weekYear"),T=require("dayjs/plugin/dayOfYear"),x=require("dayjs/plugin/isSameOrAfter"),D=require("dayjs/plugin/isSameOrBefore");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const i=require("../../constants/event.cjs");require("lodash-es");const N=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");require("../time-picker/index.cjs");const c=require("./constants.cjs"),y=require("./props/date-picker.cjs"),I=require("./panel-utils.cjs"),u=require("../time-picker/constants.cjs"),A=require("../time-picker/common/picker.vue2.cjs");r.extend(P);r.extend(O);r.extend(E);r.extend(f);r.extend(v);r.extend(T);r.extend(x);r.extend(D);const C=e.defineComponent({name:"ElDatePicker",install:null,props:y.datePickerProps,emits:[i.UPDATE_MODEL_EVENT],setup(t,{expose:s,emit:d,slots:n}){const l=N.useNamespace("picker-panel"),_=e.computed(()=>!t.format);e.provide(c.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY,_),e.provide(u.PICKER_POPPER_OPTIONS_INJECTION_KEY,e.reactive(e.toRef(t,"popperOptions"))),e.provide(c.ROOT_PICKER_INJECTION_KEY,{slots:n,pickerNs:l});const a=e.ref();s({focus:()=>{a.value?.focus()},blur:()=>{a.value?.blur()},handleOpen:()=>{a.value?.handleOpen()},handleClose:()=>{a.value?.handleClose()}});const p=o=>{d(i.UPDATE_MODEL_EVENT,o)};return()=>{const o=t.format??(u.DEFAULT_FORMATS_DATEPICKER[t.type]||u.DEFAULT_FORMATS_DATE),m=I.getPanel(t.type);return e.createVNode(A.default,e.mergeProps(t,{format:o,type:t.type,ref:a,"onUpdate:modelValue":p}),{default:q=>e.createVNode(m,q,{"prev-month":n["prev-month"],"next-month":n["next-month"],"prev-year":n["prev-year"],"next-year":n["next-year"]}),"range-separator":n["range-separator"]})}}});exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../utils/form-register.cjs");require("@vueuse/core");require("@vft/utils");require("../../config-provider/hooks/use-global-config.cjs");const e=require("vue");require("lodash-es");async function l({getSchema:o,getProps:i,formElRef:s,isInitedDefault:c}){e.watchEffect(async()=>{if(e.unref(c)||!e.unref(i).autoFocusFirstItem)return;await e.nextTick();const r=e.unref(o),t=e.unref(s),u=t?.$el;if(!t||!u||!r||r.length===0||r[0].type!==f.FormCompEnum.INPUT)return;const n=u.querySelector(".vft-row:first-child input");n&&n?.focus()})}exports.useAutoFocus=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../../../utils/form-register.cjs");require("@vueuse/core");const a=require("@vft/utils");require("../../config-provider/hooks/use-global-config.cjs");const i=require("vue"),b=require("lodash-es"),U=require("@vft/utils/date"),$=require("../component-map.cjs"),R=require("./helper.cjs");function B(p,F){const{show:l,ifShow:o}=p;let y=!0,c=!0;return typeof l=="boolean"?y=l:typeof l=="function"&&(y=l({field:p.field,model:F,values:{...F},schema:p})),typeof o=="boolean"?c=o:typeof o=="function"&&(c=o({field:p.field,model:F,values:{...F},schema:p})),y&&c}function K(p,F={}){const l=/^\[(.+)\]$/;if(l.test(p)){const o=p.match(l);if(o&&o[1]){const y=o[1].split(",");if(!y.length)return;const c=[];return y.forEach((v,I)=>{b.set(c,I,F[v.trim()])}),c.filter(Boolean).length?c:void 0}}}function k(p,F={}){const l=/^\{(.+)\}$/;if(l.test(p)){const o=p.match(l);if(o&&o[1]){const y=o[1].split(",");if(!y.length)return;const c={};return y.forEach(v=>{b.set(c,v.trim(),F[v.trim()])}),Object.values(c).filter(Boolean).length?c:void 0}}}function M({emit:p,getProps:F,formModel:l,getSchema:o,defaultValueRef:y,formElRef:c,schemaRef:v,handleFormValues:I,initValues:C}){async function z(e){const{resetFunc:n,submitOnReset:s}=i.unref(F);n&&a.isFunction(n)&&await n();const r=i.unref(c);if(r){if(e?.length)return r.resetFields(e);Object.keys(l).forEach(f=>{const u=i.unref(o).find(d=>d.field===f),t=b.cloneDeep(y.value[f]);l[f]=$.isInput(u?.type)?t||"":t}),i.nextTick(()=>V()),p("reset",i.toRaw(l)),s&&await _()}}async function S(e,n=!0){const s=i.unref(o).map(t=>t.field).filter(Boolean),r=".",f=s.filter(t=>String(t).indexOf(r)>=0),u=[];s.forEach(t=>{const d=i.unref(o).find(h=>h.field===t);let E=b.get(e,t);const q=Reflect.has(e,t);E=R.handleInputNumberValue(d?.type,E);const{componentProps:N}=d||{};let w=N;typeof N=="function"&&(w=w({formModel:i.unref(l)}));const P=K(t,e)||k(t,e);if(q||P){const h=P||E;if(X(t))if(Array.isArray(h)){const D=[];for(const O of h)D.push(O?U.formatToDate(O):null);i.unref(l)[t]=D}else i.unref(l)[t]=h?w?.valueFormat?h:U.formatToDate(h):null;else i.unref(l)[t]=h;w?.onChange&&w?.onChange(h),u.push(t)}else f.forEach(h=>{try{const D=h.split(".").reduce((O,L)=>O[L],e);a.isDef(D)&&(i.unref(l)[h]=i.unref(D),u.push(h))}catch{a.isDef(y.value[h])&&(i.unref(l)[h]=b.cloneDeep(i.unref(y.value[h])))}})}),n&&i.nextTick(async()=>{await T(u).catch(t=>{})})}async function G(e){const n=b.cloneDeep(i.unref(o));if(!e)return;let s=a.isString(e)?[e]:e;a.isString(e)&&(s=[e]);for(const r of s)H(r,n);v.value=n}function H(e,n){if(a.isString(e)){const s=n.findIndex(r=>r.field===e);s!==-1&&(delete l[e],n.splice(s,1))}}async function J(e,n,s=!1){const r=b.cloneDeep(i.unref(o)),f=r.findIndex(t=>t.field===n),u=a.isObject(e)?[e]:e;if(!n||f===-1||s){s?r.unshift(...u):r.push(...u),v.value=r,g(e);return}f!==-1&&r.splice(f+1,0,...u),g(e),v.value=r}async function Q(e){let n=[];if(a.isObject(e)&&n.push(e),a.isArray(e)&&(n=[...e]),!n.every(r=>r.type===A.FormCompEnum.DIVIDER||Reflect.has(r,"field")&&r.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}v.value=n}async function m(e){let n=[];if(a.isObject(e)&&n.push(e),a.isArray(e)&&(n=[...e]),!n.every(u=>u.type===A.FormCompEnum.DIVIDER||Reflect.has(u,"field")&&u.field)){console.error("All children of the form Schema array that need to be updated must contain the `field` field");return}const r=[],f=[];i.unref(o).forEach(u=>{let t;if(n.forEach(d=>{u.field===d.field&&(t=d),d.defaultValue&&d.field&&r.push(d.field)}),t!==void 0&&u.field===t.field){const d=a.deepMerge(u,t);f.push(d)}else f.push(u)}),g(f,r),v.value=b.uniqBy(f,"field")}function g(e,n,s=!0){if(a.isArray(n)&&n?.length===0)return;let r=[];a.isObject(e)&&r.push(e),a.isArray(e)&&(r=[...e]);const f={},u=j();r.forEach(t=>{t.type!==A.FormCompEnum.DIVIDER&&Reflect.has(t,"field")&&t.field&&!a.isNullOrUndefined(t.defaultValue)&&(!(t.field in u)||a.isNullOrUndefined(u[t.field])||a.isEmpty(u[t.field]))&&(f[t.field]=t.defaultValue)}),a.isEmptyObject(f)||S(f,s)}function j(e=!1){if(!i.unref(c))return{};const s=I(i.toRaw(i.unref(l)));if(e)return s;const r=i.unref(o).filter(u=>B(u,i.unref(l))).map(u=>u.field).filter(Boolean),f={};return r.forEach(u=>{u in s&&(f[u]=s[u])}),f}function W(e){return i.unref(c)?i.toRaw(i.unref(l))[e]:{}}function X(e){return i.unref(o).some(n=>n.field===e?$.isDatePicker(n.type):!1)}async function T(e){return e||(e=i.unref(o).filter(s=>B(s,i.unref(l))).map(s=>s.field).filter(Boolean)),i.unref(c)?.validateField(e)}async function x(e){return e||(e=i.unref(o).filter(s=>B(s,i.unref(l))).map(s=>s.field).filter(Boolean)),await i.unref(c)?.validate(e,()=>{})}async function V(e){await i.unref(c)?.clearValidate(e)}async function Y(e,n){await V(e),await m([{field:e,itemProps:{error:n}}])}async function Z(e,n){await i.unref(c)?.scrollToField(e,n)}async function _(e){const{autoCleanErrorMessage:n,watchDataIsChange:s}=i.unref(F);e&&e.preventDefault(),n&&await V();const{submitFunc:r,beforeSubmitFunc:f}=i.unref(F);if(f&&a.isFunction(f)&&await f(),r&&a.isFunction(r)){await r();return}if(i.unref(c))try{if(!await x())return;const d=j();if(s){const E=b.isEqual(C.value,d),q=a.findDifferentValuesForObj(C.value,d);p("submit",d,!E,q)}else p("submit",d)}catch(t){if(t?.outOfDate===!1&&t?.errorFields)return;throw new Error(t.message)}}return{handleSubmit:_,clearValidate:V,validate:x,validateField:T,getFieldsValue:j,updateSchema:m,resetSchema:Q,appendSchemaByField:J,removeSchemaByField:G,resetFields:z,setFieldsValue:S,scrollToField:Z,getFieldValue:W,setFormItemError:Y}}exports.useFormEvents=M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("dayjs"),p=require("dayjs/plugin/customParseFormat
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("dayjs"),p=require("dayjs/plugin/customParseFormat"),o=require("../../constants/event.cjs"),a=require("./constants.cjs"),d=require("./common/picker.vue2.cjs"),m=require("./time-picker-com/panel-time-pick.vue2.cjs"),P=require("./time-picker-com/panel-time-range.vue2.cjs"),f=require("./common/props.cjs");c.extend(p);const v=e.defineComponent({name:"VftTimePicker",install:null,props:{...f.timePickerDefaultProps,isRange:Boolean},emits:[o.UPDATE_MODEL_EVENT],setup(r,u){const t=e.ref(),[s,l]=r.isRange?["timerange",P.default]:["time",m.default],i=n=>u.emit(o.UPDATE_MODEL_EVENT,n);return e.provide(a.PICKER_POPPER_OPTIONS_INJECTION_KEY,r.popperOptions),u.expose({focus:()=>{t.value?.focus()},blur:()=>{t.value?.blur()},handleOpen:()=>{t.value?.handleOpen()},handleClose:()=>{t.value?.handleClose()}}),()=>{const n=r.format??a.DEFAULT_FORMATS_TIME;return e.createVNode(d.default,e.mergeProps(r,{ref:t,type:s,format:n,"onUpdate:modelValue":i}),{default:_=>e.createVNode(l,_,null)})}}});exports.default=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),a=require("dayjs"),C=require("dayjs/plugin/customParseFormat
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),a=require("dayjs"),C=require("dayjs/plugin/customParseFormat"),s=require("../select/index.cjs");require("../form/index.cjs");const V=require("../icon/index.cjs");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");const g=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const $=require("./time-select.cjs"),o=require("./utils.cjs"),y=require("../form/hooks/use-form-common-props.cjs"),F=r.defineComponent({name:"VftTimeSelect"}),I=r.defineComponent({...F,props:$.timeSelectProps,emits:["change","blur","focus","update:modelValue"],setup(m,{expose:c}){a.extend(C);const{Option:d}=s.default,u=m,p=g.useNamespace("input"),n=r.ref(),f=y.useFormDisabled(),b=r.computed(()=>u.modelValue),v=r.computed(()=>{const e=o.parseTime(u.start);return e?o.formatTime(e):null}),i=r.computed(()=>{const e=o.parseTime(u.end);return e?o.formatTime(e):null}),T=r.computed(()=>{const e=o.parseTime(u.step);return e?o.formatTime(e):null}),q=r.computed(()=>{const e=o.parseTime(u.minTime||"");return e?o.formatTime(e):null}),k=r.computed(()=>{const e=o.parseTime(u.maxTime||"");return e?o.formatTime(e):null}),B=r.computed(()=>{const e=[];if(u.start&&u.end&&u.step){let t=v.value,l;for(;t&&i.value&&o.compareTime(t,i.value)<=0;)l=a(t,"HH:mm").format(u.format),e.push({value:l,disabled:o.compareTime(t,q.value||"-1:-1")<=0||o.compareTime(t,k.value||"100:100")>=0}),t=o.nextTime(t,T.value)}return e});return c({blur:()=>{n.value?.blur?.()},focus:()=>{n.value?.focus?.()}}),(e,t)=>(r.openBlock(),r.createBlock(r.unref(s.default),{ref_key:"select",ref:n,"model-value":b.value,disabled:r.unref(f),clearable:e.clearable,"clear-icon":e.clearIcon,size:e.size,effect:e.effect,placeholder:e.placeholder,"default-first-option":"",filterable:e.editable,"onUpdate:modelValue":t[0]||(t[0]=l=>e.$emit("update:modelValue",l)),onChange:t[1]||(t[1]=l=>e.$emit("change",l)),onBlur:t[2]||(t[2]=l=>e.$emit("blur",l)),onFocus:t[3]||(t[3]=l=>e.$emit("focus",l))},{prefix:r.withCtx(()=>[e.prefixIcon?(r.openBlock(),r.createBlock(r.unref(V.VftIcon),{key:0,icon:e.prefixIcon,class:r.normalizeClass(r.unref(p).e("prefix-icon"))},null,8,["icon","class"])):r.createCommentVNode("",!0)]),default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(B.value,l=>(r.openBlock(),r.createBlock(r.unref(d),{key:l.value,label:l.value,value:l.value,disabled:l.disabled},null,8,["label","value","disabled"]))),128))]),_:1},8,["model-value","disabled","clearable","clear-icon","size","effect","placeholder","filterable"]))}});exports.default=I;
|
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.394";exports.version=e;
|
package/lib/package.json.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.394",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
"resize-detector": "0.3.0",
|
|
56
56
|
"sortablejs": "1.15.0",
|
|
57
57
|
"photoswipe": "5.4.4",
|
|
58
|
-
"@vft/router": "0.0.67",
|
|
59
58
|
"@vft/constants": "0.0.72",
|
|
59
|
+
"@vft/store": "0.0.54",
|
|
60
60
|
"@vft/utils": "0.0.140",
|
|
61
|
+
"@vft/router": "0.0.67",
|
|
61
62
|
"@vft/directives": "0.0.36",
|
|
62
|
-
"@vft/use": "0.0.82"
|
|
63
|
-
"@vft/store": "0.0.54"
|
|
63
|
+
"@vft/use": "0.0.82"
|
|
64
64
|
},
|
|
65
65
|
"vetur": {
|
|
66
66
|
"tags": "tags.json",
|
package/web-types.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.
|
|
1
|
+
{"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.394","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}
|