vft 0.0.511 → 0.0.514
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/dist/index.css +1 -1
- package/es/components/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- package/es/components/select/useSelect.js +231 -232
- package/es/components/super-form/super-form-item.vue2.js +66 -66
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +0 -1
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +3 -3
- package/theme-style/index.css +1 -1
- package/theme-style/src/image-viewer.scss +12 -0
- package/theme-style/src/message-box.scss +2 -2
- package/theme-style/src/table.scss +6 -0
- package/theme-style/vft-image-viewer.css +1 -1
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as fe, ref as G, computed as H, watch as J, onMounted as ke, nextTick as O, unref as d, useSlots as Ce, createVNode as f, mergeProps as U, withDirectives as Se, vShow as ve, isVNode as xe, createTextVNode as ie, resolveComponent as X } from "vue";
|
|
2
2
|
import "../alert/index.js";
|
|
3
3
|
import "../avatar/index.js";
|
|
4
4
|
import "../avatar-stack/index.js";
|
|
@@ -18,9 +18,9 @@ import "../collapse-transition/index.js";
|
|
|
18
18
|
import "../color-picker/index.js";
|
|
19
19
|
import "../config-provider/index.js";
|
|
20
20
|
import "../container/index.js";
|
|
21
|
-
import { isBoolean as Z, isFunction as k, singleAttrToObj as ae, isNullOrUndefined as
|
|
21
|
+
import { isBoolean as Z, isFunction as k, singleAttrToObj as ae, isNullOrUndefined as Ae, isArray as _, cloneDeep as Re, isString as le, isNull as we, upperFirst as Me } from "@vft/utils";
|
|
22
22
|
import "../context-menu/context-menu.vue2.js";
|
|
23
|
-
import { VftIcon as
|
|
23
|
+
import { VftIcon as se } from "../icon/index.js";
|
|
24
24
|
import "../date-picker/index.js";
|
|
25
25
|
import "../date-time-select/index.js";
|
|
26
26
|
import "../descriptions/index.js";
|
|
@@ -100,7 +100,7 @@ import "../md-container/index.js";
|
|
|
100
100
|
import "../md-tabs/index.js";
|
|
101
101
|
import "../md-vue-playground/index.js";
|
|
102
102
|
import "../infinite-scroll/index.js";
|
|
103
|
-
import { FormCompEnum as t, getComponent as
|
|
103
|
+
import { FormCompEnum as t, getComponent as ce } from "../../utils/form-register.js";
|
|
104
104
|
import "@vueuse/core";
|
|
105
105
|
import "../config-provider/hooks/use-global-config.js";
|
|
106
106
|
import { debounce as qe } from "lodash-es";
|
|
@@ -113,13 +113,13 @@ import "../message-box/index.js";
|
|
|
113
113
|
import "../progress-i/index.js";
|
|
114
114
|
import "./index.js";
|
|
115
115
|
import { isRangePicker as Fe, isInput as Le, isDatePicker as Ve } from "./component-map.js";
|
|
116
|
-
import { createPlaceholderMessage as
|
|
116
|
+
import { createPlaceholderMessage as me } from "./use/helper.js";
|
|
117
117
|
function ee(e) {
|
|
118
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
118
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
|
|
119
119
|
}
|
|
120
|
-
const je =
|
|
120
|
+
const je = fe({
|
|
121
121
|
inheritAttrs: !1
|
|
122
|
-
}), Jo = /* @__PURE__ */
|
|
122
|
+
}), Jo = /* @__PURE__ */ fe({
|
|
123
123
|
...je,
|
|
124
124
|
__name: "super-form-item",
|
|
125
125
|
props: {
|
|
@@ -148,10 +148,10 @@ const je = me({
|
|
|
148
148
|
elRef: F,
|
|
149
149
|
formActionType: e.formActionType
|
|
150
150
|
};
|
|
151
|
-
}),
|
|
151
|
+
}), ue = /* @__PURE__ */ new Set([t.Select, t.Radio, t.Checkbox, t.RadioButton, t.CheckboxButton, t.Cascader, t.AutoComplete]), L = /* @__PURE__ */ new Set([t.Select, t.Radio, t.RadioButton, t.Checkbox, t.CheckboxButton, t.Cascader, t.AutoComplete]), z = /* @__PURE__ */ new Set([t.Tree, t.TreeSelect]), Y = () => e.schema.type && ue.has(e.schema.type) ? {
|
|
152
152
|
options: []
|
|
153
153
|
} : {}, p = G(Y());
|
|
154
|
-
async function
|
|
154
|
+
async function de() {
|
|
155
155
|
const {
|
|
156
156
|
componentProps: r = {}
|
|
157
157
|
} = e.schema;
|
|
@@ -174,9 +174,9 @@ const je = me({
|
|
|
174
174
|
} else
|
|
175
175
|
p.value = r, L.has(e.schema.type) && (!p.value.options || !Array.isArray(p.value.options)) && (p.value.options = []);
|
|
176
176
|
}
|
|
177
|
-
J(() => e.schema.componentProps, (r, o) => (r || o) &&
|
|
177
|
+
J(() => e.schema.componentProps, (r, o) => (r || o) && de(), {
|
|
178
178
|
immediate: !0
|
|
179
|
-
}),
|
|
179
|
+
}), ke(() => {
|
|
180
180
|
if (e.schema.type === t.Tree) {
|
|
181
181
|
const r = e.formModel[e.schema.field], o = p.value, i = o?.defaultCheckedKeys, n = o?.includeHalfChecked;
|
|
182
182
|
i && Array.isArray(i) && i.length > 0 && (!r || !Array.isArray(r) || r.length === 0) && (n ? O(() => {
|
|
@@ -194,7 +194,7 @@ const je = me({
|
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
let A = null;
|
|
197
|
-
const N = G(!1),
|
|
197
|
+
const N = G(!1), B = async (r, o) => {
|
|
198
198
|
try {
|
|
199
199
|
const i = {
|
|
200
200
|
...p.value
|
|
@@ -247,7 +247,7 @@ const je = me({
|
|
|
247
247
|
const r = p.value?.request;
|
|
248
248
|
if (r)
|
|
249
249
|
if (k(r))
|
|
250
|
-
|
|
250
|
+
B(r);
|
|
251
251
|
else {
|
|
252
252
|
const {
|
|
253
253
|
watchFields: o = [],
|
|
@@ -259,21 +259,21 @@ const je = me({
|
|
|
259
259
|
if (!a) return;
|
|
260
260
|
const u = Array.isArray(o) && o.length > 0;
|
|
261
261
|
if (i?.immediate && !u) {
|
|
262
|
-
N.value || (N.value = !0,
|
|
262
|
+
N.value || (N.value = !0, B(a, m));
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
const {
|
|
266
266
|
immediate: C,
|
|
267
267
|
...h
|
|
268
|
-
} = i,
|
|
269
|
-
|
|
268
|
+
} = i, g = o.map((s) => () => e.formModel[s]), y = n > 0 ? qe(() => {
|
|
269
|
+
B(a, m);
|
|
270
270
|
}, n) : () => {
|
|
271
|
-
|
|
271
|
+
B(a, m);
|
|
272
272
|
};
|
|
273
|
-
A = J(
|
|
273
|
+
A = J(g, y, h), i?.immediate && (N.value || (N.value = !0, B(a, m)));
|
|
274
274
|
}
|
|
275
|
-
},
|
|
276
|
-
J(
|
|
275
|
+
}, he = H(() => E());
|
|
276
|
+
J(he, (r, o) => {
|
|
277
277
|
r.isIfShow && r.isShow && (o == null || !o.isIfShow || !o.isShow) ? O(() => {
|
|
278
278
|
A && (A(), A = null), te();
|
|
279
279
|
}) : (!r.isIfShow || !r.isShow) && (N.value = !1, A && (A(), A = null));
|
|
@@ -347,7 +347,7 @@ const je = me({
|
|
|
347
347
|
e.schema.type && o.has(e.schema.type) && (r = Object.assign(o.get(e.schema.type) || {}, r));
|
|
348
348
|
const i = r;
|
|
349
349
|
return e.formProps.inputMaxLength && e.schema.type === t.Input && !i?.maxlength && (i.maxlength = e.formProps.inputMaxLength), L.has(e.schema.type) && (!i.options || !Array.isArray(i.options)) && (i.options = []), z.has(e.schema.type) && (!i.data || !Array.isArray(i.data)) && (i.data = []), i;
|
|
350
|
-
}),
|
|
350
|
+
}), pe = H(() => {
|
|
351
351
|
const {
|
|
352
352
|
disabled: r
|
|
353
353
|
} = e.formProps, {
|
|
@@ -369,7 +369,7 @@ const je = me({
|
|
|
369
369
|
isIfShow: n
|
|
370
370
|
};
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function ye() {
|
|
373
373
|
const {
|
|
374
374
|
rules: r = [],
|
|
375
375
|
type: o = t.Input,
|
|
@@ -379,19 +379,19 @@ const je = me({
|
|
|
379
379
|
dynamicRule: m,
|
|
380
380
|
required: u,
|
|
381
381
|
dynamicRuleAdd: C = !0
|
|
382
|
-
} = e.schema, h = k(u) ? u(d(P)) : u,
|
|
383
|
-
if (!h && (
|
|
382
|
+
} = e.schema, h = k(u) ? u(d(P)) : u, g = e.formModel[e.schema.field];
|
|
383
|
+
if (!h && (Ae(g) || g === "" || _(g) && !g.length))
|
|
384
384
|
return [];
|
|
385
|
-
const
|
|
385
|
+
const y = n || a;
|
|
386
386
|
if (k(m) && !C)
|
|
387
387
|
return m(d(P));
|
|
388
|
-
let s =
|
|
388
|
+
let s = Re(_(r) ? r : [r]);
|
|
389
389
|
const {
|
|
390
390
|
rulesMessageJoinLabel: R
|
|
391
|
-
} = e.formProps, b = Reflect.has(e.schema, "rulesMessageJoinLabel") ? i : R, w =
|
|
391
|
+
} = e.formProps, b = Reflect.has(e.schema, "rulesMessageJoinLabel") ? i : R, w = me(o, b && le(y) ? y : "");
|
|
392
392
|
function M(l, c) {
|
|
393
393
|
const x = l.message || w;
|
|
394
|
-
return c === void 0 ||
|
|
394
|
+
return c === void 0 || we(c) || o === t.CheckboxSingle && !c || Array.isArray(c) && c.length === 0 || typeof c == "string" && c.trim() === "" || typeof c == "object" && Reflect.has(c, "checked") && Reflect.has(c, "halfChecked") && Array.isArray(c.checked) && Array.isArray(c.halfChecked) && c.checked.length === 0 && c.halfChecked.length === 0 ? Promise.reject(x) : Promise.resolve();
|
|
395
395
|
}
|
|
396
396
|
const V = [t.Radio, t.Select, t.RadioSingle, t.RadioButton, t.Checkbox, t.CheckboxSingle, t.CheckboxButton, t.AutoComplete, t.Cascader, t.ColorPicker, t.Upload, t.Slider].includes(o);
|
|
397
397
|
(!s || s.length === 0 || h) && (s = [{
|
|
@@ -408,18 +408,18 @@ const je = me({
|
|
|
408
408
|
}
|
|
409
409
|
const v = s.findIndex((l) => l.min), D = s.findIndex((l) => l.max);
|
|
410
410
|
function j(l, c, x = "all") {
|
|
411
|
-
const S = s[c],
|
|
412
|
-
return ["min", "all"].includes(x) &&
|
|
411
|
+
const S = s[c], $ = S.isNumber ? isNaN(l) ? l?.length || 0 : Number(l) : l?.length || 0;
|
|
412
|
+
return ["min", "all"].includes(x) && $ < S.min ? Promise.reject(`${y}至少${S.min}个字符`) : ["max", "all"].includes(x) && $ > S.max ? Promise.reject(`${y}最多${S.max}个字符`) : Promise.resolve();
|
|
413
413
|
}
|
|
414
414
|
(v !== -1 || D !== -1) && (v !== -1 && D !== -1 && !s[v].validator && !s[v].message ? s[v].validator = (l, c) => j(c, v) : v !== -1 && !s[v].validator && !s[v].message ? s[v].validator = (l, c) => j(c, v, "min") : D !== -1 && !s[D].validator && !s[D].message && (s[D].validator = (l, c) => j(c, D, "max")));
|
|
415
415
|
const T = s.findIndex((l) => l.len);
|
|
416
|
-
if (T !== -1 && (s[T].validator = (l, c) => c?.length !== s[T].len ? Promise.reject(`${
|
|
416
|
+
if (T !== -1 && (s[T].validator = (l, c) => c?.length !== s[T].len ? Promise.reject(`${y}必须为${s[T].len}个字符`) : Promise.resolve()), k(m) && C) {
|
|
417
417
|
let l = m(d(P));
|
|
418
418
|
l = _(l) ? l : [l], s = s.concat(l);
|
|
419
419
|
}
|
|
420
420
|
return s;
|
|
421
421
|
}
|
|
422
|
-
const
|
|
422
|
+
const ge = () => {
|
|
423
423
|
const {
|
|
424
424
|
renderComponentContent: r,
|
|
425
425
|
type: o = t.Input,
|
|
@@ -432,26 +432,26 @@ const je = me({
|
|
|
432
432
|
} = e.schema;
|
|
433
433
|
let h = n;
|
|
434
434
|
Le(o) ? h = "input" : Ve(o) || o === t.TimePicker || o === t.InputTag || o === t.AutoComplete || o === t.Cascader || o === t.ColorPicker || o === t.Slider || o === t.TreeSelect ? h = "update:modelValue" : o === t.Upload ? h = "update:fileList" : o === t.Tree && (h = "check");
|
|
435
|
-
const
|
|
435
|
+
const g = `on${Me(h)}`, y = ce(o), {
|
|
436
436
|
autoSetPlaceHolder: s,
|
|
437
437
|
size: R
|
|
438
438
|
} = e.formProps, b = {
|
|
439
439
|
clearable: !0,
|
|
440
440
|
...d(K)
|
|
441
441
|
};
|
|
442
|
-
if (o !== t.Search && (b.size = d(K)?.size || R, b.disabled = d(
|
|
442
|
+
if (o !== t.Search && (b.size = d(K)?.size || R, b.disabled = d(pe)), !b.disabled && s && !Fe(o) && o) {
|
|
443
443
|
const l = m || u;
|
|
444
|
-
b.placeholder = d(K)?.placeholder ||
|
|
444
|
+
b.placeholder = d(K)?.placeholder || me(o, C && le(l) ? l : "");
|
|
445
445
|
}
|
|
446
|
-
const M = b[
|
|
447
|
-
[
|
|
446
|
+
const M = b[g], I = b.onClear, V = {
|
|
447
|
+
[g]: (...l) => {
|
|
448
448
|
const [c] = l;
|
|
449
449
|
let x;
|
|
450
450
|
if (o === t.Tree && h === "check") {
|
|
451
|
-
const [, S] = l,
|
|
452
|
-
if (
|
|
453
|
-
const
|
|
454
|
-
e.formModel[
|
|
451
|
+
const [, S] = l, $ = d(K)?.includeHalfChecked;
|
|
452
|
+
if ($ ? x = [...S?.halfCheckedKeys || [], ...S?.checkedKeys || []] : x = S?.checkedKeys || [], $) {
|
|
453
|
+
const Pe = Symbol.for(`${i}_checkedKeys`);
|
|
454
|
+
e.formModel[Pe] = S?.checkedKeys || [];
|
|
455
455
|
}
|
|
456
456
|
} else {
|
|
457
457
|
const S = c ? c.target : null;
|
|
@@ -473,7 +473,7 @@ const je = me({
|
|
|
473
473
|
}, W = o === t.Tree ? {} : {
|
|
474
474
|
[a || "model-value"]: e.formModel[i]
|
|
475
475
|
}, {
|
|
476
|
-
[
|
|
476
|
+
[g]: v,
|
|
477
477
|
...D
|
|
478
478
|
} = b, j = {
|
|
479
479
|
...D,
|
|
@@ -481,7 +481,7 @@ const je = me({
|
|
|
481
481
|
...W
|
|
482
482
|
};
|
|
483
483
|
if (!r && o !== t.Upload)
|
|
484
|
-
return f(
|
|
484
|
+
return f(y, U({
|
|
485
485
|
ref: F
|
|
486
486
|
}, j), null);
|
|
487
487
|
let T;
|
|
@@ -510,7 +510,7 @@ const je = me({
|
|
|
510
510
|
})
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
return f(
|
|
513
|
+
return f(y, U({
|
|
514
514
|
ref: F
|
|
515
515
|
}, j), ee(T) ? T : {
|
|
516
516
|
default: () => [T]
|
|
@@ -528,11 +528,11 @@ const je = me({
|
|
|
528
528
|
labelSuffix: C
|
|
529
529
|
} = e.schema, {
|
|
530
530
|
labelSuffix: h = ""
|
|
531
|
-
} = e.formProps,
|
|
531
|
+
} = e.formProps, g = C ?? h, y = o || i, s = y ? f("span", null, [a && f("span", {
|
|
532
532
|
class: "label-required"
|
|
533
|
-
}, [ie("*")]), f("span", null, [
|
|
533
|
+
}, [ie("*")]), f("span", null, [y]), g && f("span", {
|
|
534
534
|
class: q.m("label-suffix")
|
|
535
|
-
}, [
|
|
535
|
+
}, [g])]) : null, R = () => {
|
|
536
536
|
if (!m && !u) return null;
|
|
537
537
|
const b = H(() => ae(m, "icon", {
|
|
538
538
|
size: 20,
|
|
@@ -546,10 +546,10 @@ const je = me({
|
|
|
546
546
|
return f(De, U({
|
|
547
547
|
className: "box-item"
|
|
548
548
|
}, w.value), {
|
|
549
|
-
default: () => [f(
|
|
549
|
+
default: () => [f(se, b.value, null)]
|
|
550
550
|
});
|
|
551
551
|
}
|
|
552
|
-
return f(
|
|
552
|
+
return f(se, b.value, null);
|
|
553
553
|
};
|
|
554
554
|
return r && s ? n ? f("div", {
|
|
555
555
|
class: "label-content"
|
|
@@ -559,7 +559,7 @@ const je = me({
|
|
|
559
559
|
class: "label-content"
|
|
560
560
|
}, [f("div", null, [s]), R()]) : void 0;
|
|
561
561
|
}
|
|
562
|
-
const oe =
|
|
562
|
+
const oe = Ce();
|
|
563
563
|
function re(r, o = "default", i) {
|
|
564
564
|
if (!r || !Reflect.has(r, o))
|
|
565
565
|
return null;
|
|
@@ -568,7 +568,7 @@ const je = me({
|
|
|
568
568
|
const n = r[o];
|
|
569
569
|
return n ? n(i) : null;
|
|
570
570
|
}
|
|
571
|
-
function
|
|
571
|
+
function be() {
|
|
572
572
|
const {
|
|
573
573
|
required: r,
|
|
574
574
|
itemProps: o,
|
|
@@ -580,8 +580,8 @@ const je = me({
|
|
|
580
580
|
prefixParentStyle: C
|
|
581
581
|
} = e.schema, {
|
|
582
582
|
autoCleanErrorMessage: h,
|
|
583
|
-
compFullWidth:
|
|
584
|
-
} = e.formProps,
|
|
583
|
+
compFullWidth: g
|
|
584
|
+
} = e.formProps, y = () => i ? re(oe, i, d(P)) : n ? n(d(P)) : ge(), s = !!m, R = !!u, b = k(m) ? m(d(P)) : m, w = k(u) ? u(d(P)) : u, M = () => {
|
|
585
585
|
e.updateSchema([{
|
|
586
586
|
field: a,
|
|
587
587
|
itemProps: {
|
|
@@ -596,20 +596,20 @@ const je = me({
|
|
|
596
596
|
class: [{
|
|
597
597
|
[q.is("suffix")]: s
|
|
598
598
|
}, {
|
|
599
|
-
[q.is("comp-full-width")]:
|
|
599
|
+
[q.is("comp-full-width")]: g
|
|
600
600
|
}, q.e("item")]
|
|
601
601
|
}, o, {
|
|
602
602
|
label: o?.label || o?.title,
|
|
603
603
|
"onUpdate:error": h ? M : () => {
|
|
604
604
|
},
|
|
605
|
-
rules:
|
|
605
|
+
rules: ye(),
|
|
606
606
|
required: I
|
|
607
607
|
}), {
|
|
608
608
|
default: () => [f("div", {
|
|
609
609
|
class: q.e("container")
|
|
610
610
|
}, [f("div", {
|
|
611
611
|
class: q.e("content")
|
|
612
|
-
}, [
|
|
612
|
+
}, [y(), s && f("span", {
|
|
613
613
|
class: q.m("suffix")
|
|
614
614
|
}, [b])])])],
|
|
615
615
|
label: Q() ? () => Q() : void 0
|
|
@@ -630,41 +630,41 @@ const je = me({
|
|
|
630
630
|
render: m,
|
|
631
631
|
quickColSpan: u
|
|
632
632
|
} = e.schema;
|
|
633
|
-
if (!
|
|
633
|
+
if (!ce(a) && !n && !m)
|
|
634
634
|
return null;
|
|
635
635
|
const {
|
|
636
636
|
baseColProps: C = {},
|
|
637
637
|
quickColSpan: h
|
|
638
|
-
} = e.formProps,
|
|
638
|
+
} = e.formProps, g = h ? {
|
|
639
639
|
span: Math.ceil(24 / h),
|
|
640
640
|
...C
|
|
641
641
|
} : {
|
|
642
642
|
...C
|
|
643
|
-
},
|
|
643
|
+
}, y = u ? {
|
|
644
644
|
span: Math.ceil(24 / u),
|
|
645
645
|
...o
|
|
646
646
|
} : {
|
|
647
647
|
...o
|
|
648
648
|
}, s = {
|
|
649
|
-
...
|
|
650
|
-
...
|
|
649
|
+
...g,
|
|
650
|
+
...y
|
|
651
651
|
}, {
|
|
652
652
|
isIfShow: R,
|
|
653
653
|
isShow: b
|
|
654
|
-
} = E(), w = d(P), M = () => i ? re(oe, i, w) : n ? n(w) :
|
|
654
|
+
} = E(), w = d(P), M = () => i ? re(oe, i, w) : n ? n(w) : be();
|
|
655
655
|
if (a === t.Divider) {
|
|
656
656
|
let I;
|
|
657
657
|
return f(ne, U({
|
|
658
658
|
span: 24
|
|
659
|
-
},
|
|
659
|
+
}, y), {
|
|
660
660
|
default: () => [f(Ie, d(K), ee(I = Q()) ? I : {
|
|
661
661
|
default: () => [I]
|
|
662
662
|
})]
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
|
-
return R && (e.formProps.customLayout ? M() :
|
|
665
|
+
return R && (e.formProps.customLayout ? M() : Se(f(ne, s, ee(r = M()) ? r : {
|
|
666
666
|
default: () => [r]
|
|
667
|
-
}), [[
|
|
667
|
+
}), [[ve, b]]));
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
670
|
});
|
|
@@ -1,110 +1,109 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as F, inject as L, ref as C, computed as d, openBlock as w, createBlock as Q, Transition as W, withCtx as X, createElementBlock as Z, normalizeClass as r, unref as s, createElementVNode as p, createVNode as ee, createCommentVNode as te } from "vue";
|
|
2
2
|
import f from "dayjs";
|
|
3
|
-
import { EVENT_CODE as
|
|
3
|
+
import { EVENT_CODE as ne } from "../../../constants/aria.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
|
-
import { isUndefined as
|
|
5
|
+
import { isUndefined as oe } from "@vft/utils";
|
|
6
6
|
import "../../config-provider/hooks/use-global-config.js";
|
|
7
7
|
import "lodash-es";
|
|
8
8
|
import "../../form/index.js";
|
|
9
|
-
import { useNamespace as
|
|
9
|
+
import { useNamespace as se } from "../../../hooks/use-namespace/index.js";
|
|
10
10
|
import "../../../hooks/use-model-toggle/index.js";
|
|
11
11
|
import "@popperjs/core";
|
|
12
12
|
import "../../../hooks/use-z-index/index.js";
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
const Pe = /* @__PURE__ */ Q({
|
|
13
|
+
import { PICKER_BASE_INJECTION_KEY as ae } from "../constants.js";
|
|
14
|
+
import { panelTimePickerProps as ie } from "../props/panel-time-picker.js";
|
|
15
|
+
import { useTimePanel as re } from "../composables/use-time-panel.js";
|
|
16
|
+
import { useOldValue as le, buildAvailableTimeSlotGetter as ce } from "../composables/use-time-picker.js";
|
|
17
|
+
import pe from "./basic-time-spinner.vue2.js";
|
|
18
|
+
const _e = /* @__PURE__ */ F({
|
|
20
19
|
__name: "panel-time-pick",
|
|
21
|
-
props:
|
|
20
|
+
props: ie,
|
|
22
21
|
emits: ["pick", "select-range", "set-picker-option"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
arrowControl:
|
|
22
|
+
setup(T, { emit: A }) {
|
|
23
|
+
const n = T, o = A, R = L(ae), {
|
|
24
|
+
arrowControl: E,
|
|
26
25
|
disabledHours: b,
|
|
27
26
|
disabledMinutes: g,
|
|
28
27
|
disabledSeconds: v,
|
|
29
|
-
defaultValue:
|
|
30
|
-
} =
|
|
31
|
-
const t = f(e).locale(
|
|
28
|
+
defaultValue: _
|
|
29
|
+
} = R.props, { getAvailableHours: N, getAvailableMinutes: O, getAvailableSeconds: D } = ce(b, g, v), i = se("time"), u = C("zh-cn"), k = C([0, 2]), y = le(n), I = d(() => oe(n.actualVisible) ? `${i.namespace.value}-zoom-in-top` : ""), l = d(() => n.format.includes("ss")), P = d(() => n.format.includes("A") ? "A" : n.format.includes("a") ? "a" : ""), B = (e) => {
|
|
30
|
+
const t = f(e).locale(u.value), a = m(t);
|
|
32
31
|
return t.isSame(a);
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
t ||
|
|
37
|
-
},
|
|
38
|
-
if (!
|
|
32
|
+
}, K = () => {
|
|
33
|
+
o("pick", y.value, !1);
|
|
34
|
+
}, x = (e = !1, t = !1) => {
|
|
35
|
+
t || o("pick", n.parsedValue, e);
|
|
36
|
+
}, z = (e) => {
|
|
37
|
+
if (!n.visible)
|
|
39
38
|
return;
|
|
40
|
-
const t =
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
39
|
+
const t = m(e).millisecond(0);
|
|
40
|
+
o("pick", t, !0);
|
|
41
|
+
}, M = (e, t) => {
|
|
42
|
+
o("select-range", e, t), k.value = [e, t];
|
|
43
|
+
}, U = (e) => {
|
|
45
44
|
const t = [0, 3].concat(l.value ? [6] : []), a = ["hours", "minutes"].concat(
|
|
46
45
|
l.value ? ["seconds"] : []
|
|
47
|
-
), c = (t.indexOf(
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
const t = e.code, { left: a, right:
|
|
51
|
-
if ([a,
|
|
52
|
-
|
|
46
|
+
), c = (t.indexOf(k.value[0]) + e + t.length) % t.length;
|
|
47
|
+
h.start_emitSelectRange(a[c]);
|
|
48
|
+
}, $ = (e) => {
|
|
49
|
+
const t = e.code, { left: a, right: V, up: c, down: q } = ne;
|
|
50
|
+
if ([a, V].includes(t)) {
|
|
51
|
+
U(t === a ? -1 : 1), e.preventDefault();
|
|
53
52
|
return;
|
|
54
53
|
}
|
|
55
|
-
if ([c,
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
if ([c, q].includes(t)) {
|
|
55
|
+
const S = t === c ? -1 : 1;
|
|
56
|
+
h.start_scrollDown(S), e.preventDefault();
|
|
58
57
|
}
|
|
59
|
-
}, { timePickerOptions:
|
|
60
|
-
getAvailableHours:
|
|
61
|
-
getAvailableMinutes:
|
|
62
|
-
getAvailableSeconds:
|
|
63
|
-
}),
|
|
64
|
-
return
|
|
65
|
-
default:
|
|
66
|
-
e.actualVisible || e.visible ? (
|
|
58
|
+
}, { timePickerOptions: h, onSetOption: j, getAvailableTime: H } = re({
|
|
59
|
+
getAvailableHours: N,
|
|
60
|
+
getAvailableMinutes: O,
|
|
61
|
+
getAvailableSeconds: D
|
|
62
|
+
}), m = (e) => H(e, n.datetimeRole || "", !0), G = (e) => e ? f(e, n.format).locale(u.value) : null, J = (e) => e ? e.format(n.format) : null, Y = () => f(_).locale(u.value);
|
|
63
|
+
return o("set-picker-option", ["isValidValue", B]), o("set-picker-option", ["formatToString", J]), o("set-picker-option", ["parseUserInput", G]), o("set-picker-option", ["handleKeydownInput", $]), o("set-picker-option", ["getRangeAvailableTime", m]), o("set-picker-option", ["getDefaultValue", Y]), (e, t) => (w(), Q(W, { name: I.value }, {
|
|
64
|
+
default: X(() => [
|
|
65
|
+
e.actualVisible || e.visible ? (w(), Z("div", {
|
|
67
66
|
key: 0,
|
|
68
|
-
class: r(
|
|
67
|
+
class: r(s(i).b("panel"))
|
|
69
68
|
}, [
|
|
70
69
|
p("div", {
|
|
71
|
-
class: r([
|
|
70
|
+
class: r([s(i).be("panel", "content"), { "has-seconds": l.value }])
|
|
72
71
|
}, [
|
|
73
|
-
|
|
72
|
+
ee(pe, {
|
|
74
73
|
ref: "spinner",
|
|
75
74
|
role: e.datetimeRole || "start",
|
|
76
|
-
"arrow-control":
|
|
75
|
+
"arrow-control": s(E),
|
|
77
76
|
"show-seconds": l.value,
|
|
78
|
-
"am-pm-mode":
|
|
77
|
+
"am-pm-mode": P.value,
|
|
79
78
|
"spinner-date": e.parsedValue,
|
|
80
|
-
"disabled-hours":
|
|
81
|
-
"disabled-minutes":
|
|
82
|
-
"disabled-seconds":
|
|
83
|
-
onChange:
|
|
84
|
-
onSetOption:
|
|
85
|
-
onSelectRange:
|
|
79
|
+
"disabled-hours": s(b),
|
|
80
|
+
"disabled-minutes": s(g),
|
|
81
|
+
"disabled-seconds": s(v),
|
|
82
|
+
onChange: z,
|
|
83
|
+
onSetOption: s(j),
|
|
84
|
+
onSelectRange: M
|
|
86
85
|
}, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
|
|
87
86
|
], 2),
|
|
88
87
|
p("div", {
|
|
89
|
-
class: r(
|
|
88
|
+
class: r(s(i).be("panel", "footer"))
|
|
90
89
|
}, [
|
|
91
90
|
p("button", {
|
|
92
91
|
type: "button",
|
|
93
|
-
class: r(["cancel", [
|
|
94
|
-
onClick:
|
|
95
|
-
},
|
|
92
|
+
class: r(["cancel", [s(i).be("panel", "btn")]]),
|
|
93
|
+
onClick: K
|
|
94
|
+
}, " 取消 ", 2),
|
|
96
95
|
p("button", {
|
|
97
96
|
type: "button",
|
|
98
|
-
class: r(["confirm", [
|
|
99
|
-
onClick: t[0] || (t[0] = (a) =>
|
|
100
|
-
},
|
|
97
|
+
class: r(["confirm", [s(i).be("panel", "btn")]]),
|
|
98
|
+
onClick: t[0] || (t[0] = (a) => x())
|
|
99
|
+
}, " 确认 ", 2)
|
|
101
100
|
], 2)
|
|
102
|
-
], 2)) :
|
|
101
|
+
], 2)) : te("", !0)
|
|
103
102
|
]),
|
|
104
103
|
_: 1
|
|
105
104
|
}, 8, ["name"]));
|
|
106
105
|
}
|
|
107
106
|
});
|
|
108
107
|
export {
|
|
109
|
-
|
|
108
|
+
_e as default
|
|
110
109
|
};
|