vft 0.0.441 → 0.0.442
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/carousel/use-carousel.js +1 -1
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/table/index.d.ts +0 -54
- package/es/components/table/table.vue2.js +52 -60
- package/es/package.json.d.ts +4 -4
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/table/index.d.ts +0 -54
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +4 -4
- package/package.json +7 -7
- package/web-types.json +1 -1
|
@@ -11,7 +11,7 @@ import "../../hooks/use-model-toggle/index.js";
|
|
|
11
11
|
import { useOrderedChildren as ge } from "../../hooks/use-ordered-children/index.js";
|
|
12
12
|
import "@popperjs/core";
|
|
13
13
|
import "../../hooks/use-z-index/index.js";
|
|
14
|
-
import {
|
|
14
|
+
import { CAROUSEL_ITEM_NAME as H, carouselContextKey as Se } from "./constants.js";
|
|
15
15
|
const L = 300, ze = (t, O, M) => {
|
|
16
16
|
const {
|
|
17
17
|
children: o,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { keysOf as f } from "@vft/utils";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import { debugWarn as v } from "../../../utils/error.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getCurrentInstance as l, computed as i, unref as p, provide as g, ref as C, inject as x } from "vue";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../../form/index.js";
|
|
7
7
|
import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
|
|
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
|
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
|
|
11
11
|
import { configProviderContextKey as m } from "../constants.js";
|
|
12
|
-
const a =
|
|
12
|
+
const a = C();
|
|
13
13
|
function d(o, e = void 0) {
|
|
14
14
|
const n = l() ? x(m, a) : a;
|
|
15
15
|
return o ? i(() => n?.value?.[o] ?? e) : n;
|
|
@@ -27,7 +27,7 @@ function B(o) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
const S = (o, e, n = !1) => {
|
|
30
|
-
const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ?
|
|
30
|
+
const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? g : void 0);
|
|
31
31
|
if (!u) {
|
|
32
32
|
v(
|
|
33
33
|
"provideGlobalConfig",
|
|
@@ -13,8 +13,8 @@ import "../../hooks/use-z-index/index.js";
|
|
|
13
13
|
import { UPDATE_MODEL_EVENT as Q } from "@vft/constants";
|
|
14
14
|
import { useAttrs as Ze, useCursor as _e } from "@vft/use";
|
|
15
15
|
import { calcTextareaHeight as he } from "./utils.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { useFormSize as et, useFormDisabled as tt } from "../form/hooks/use-form-common-props.js";
|
|
17
|
+
import { useFormItem as at, useFormItemInputId as nt } from "../form/hooks/use-form-item.js";
|
|
18
18
|
const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"], st = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"], It = /* @__PURE__ */ Oe({
|
|
19
19
|
__name: "input",
|
|
20
20
|
props: {
|
|
@@ -85,9 +85,9 @@ const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
|
|
|
85
85
|
n.is("focus", v.value)
|
|
86
86
|
]), d = Ze({
|
|
87
87
|
excludeKeys: l(() => Object.keys(X.value))
|
|
88
|
-
}), { form: Ce, formItem: F } =
|
|
88
|
+
}), { form: Ce, formItem: F } = at(), { inputId: Y } = nt(we.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke =
|
|
90
|
+
}), ke = et(), x = tt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
|
|
91
91
|
icon: "icon-circle-close",
|
|
92
92
|
size: 16
|
|
93
93
|
})), te = l(() => Ce?.statusIcon ?? !1), I = l(() => F?.validateState || ""), ae = l(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { shallowRef as B, ref as L, computed as c, watch as G } from "vue";
|
|
2
2
|
import { EVENT_CODE as g } from "../../../constants/aria.js";
|
|
3
|
-
import { CHANGE_EVENT as i,
|
|
3
|
+
import { CHANGE_EVENT as i, INPUT_EVENT as H, UPDATE_MODEL_EVENT as d } from "../../../constants/event.js";
|
|
4
4
|
import "@vueuse/core";
|
|
5
5
|
import { isUndefined as K } from "@vft/utils";
|
|
6
6
|
import { debugWarn as C } from "../../../utils/error.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Q, computed as v, ref as re, unref as c, useSlots as oe, createVNode as s, mergeProps as L, withDirectives as ie, vShow as ne,
|
|
1
|
+
import { defineComponent as Q, computed as v, ref as re, unref as c, useSlots as oe, createVNode as s, mergeProps as L, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as G, resolveComponent as V } from "vue";
|
|
2
2
|
import "../alert/index.js";
|
|
3
3
|
import "../avatar/index.js";
|
|
4
4
|
import "../avatar-stack/index.js";
|
|
@@ -177,18 +177,9 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
177
177
|
footerCellStyle: {
|
|
178
178
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FooterCellStyle<any>>;
|
|
179
179
|
};
|
|
180
|
-
showCustomHeader: {
|
|
181
|
-
type: import("vue").PropType<boolean>;
|
|
182
|
-
};
|
|
183
|
-
mergeHeaderCells: {
|
|
184
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeHeaderCells>;
|
|
185
|
-
};
|
|
186
180
|
mergeCells: {
|
|
187
181
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeCells<any>>;
|
|
188
182
|
};
|
|
189
|
-
mergeFooterCells: {
|
|
190
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeFooterCells<any>>;
|
|
191
|
-
};
|
|
192
183
|
mergeFooterItems: {
|
|
193
184
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeFooterItems<any>>;
|
|
194
185
|
};
|
|
@@ -270,24 +261,15 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
270
261
|
filterConfig: {
|
|
271
262
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FilterConfig<any>>;
|
|
272
263
|
};
|
|
273
|
-
floatingFilterConfig: {
|
|
274
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FloatingFilterConfig<any>>;
|
|
275
|
-
};
|
|
276
264
|
radioConfig: {
|
|
277
265
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.RadioConfig<any>>;
|
|
278
266
|
};
|
|
279
267
|
checkboxConfig: {
|
|
280
268
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.CheckboxConfig<any>>;
|
|
281
269
|
};
|
|
282
|
-
headerTooltipConfig: {
|
|
283
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.HeaderTooltipConfig<any>>;
|
|
284
|
-
};
|
|
285
270
|
tooltipConfig: {
|
|
286
271
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.TooltipConfig<any>>;
|
|
287
272
|
};
|
|
288
|
-
footerTooltipConfig: {
|
|
289
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FooterTooltipConfig<any>>;
|
|
290
|
-
};
|
|
291
273
|
exportConfig: {
|
|
292
274
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.ExportConfig>;
|
|
293
275
|
};
|
|
@@ -1105,18 +1087,9 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1105
1087
|
footerCellStyle: {
|
|
1106
1088
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FooterCellStyle<any>>;
|
|
1107
1089
|
};
|
|
1108
|
-
showCustomHeader: {
|
|
1109
|
-
type: import("vue").PropType<boolean>;
|
|
1110
|
-
};
|
|
1111
|
-
mergeHeaderCells: {
|
|
1112
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeHeaderCells>;
|
|
1113
|
-
};
|
|
1114
1090
|
mergeCells: {
|
|
1115
1091
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeCells<any>>;
|
|
1116
1092
|
};
|
|
1117
|
-
mergeFooterCells: {
|
|
1118
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeFooterCells<any>>;
|
|
1119
|
-
};
|
|
1120
1093
|
mergeFooterItems: {
|
|
1121
1094
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeFooterItems<any>>;
|
|
1122
1095
|
};
|
|
@@ -1198,24 +1171,15 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1198
1171
|
filterConfig: {
|
|
1199
1172
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FilterConfig<any>>;
|
|
1200
1173
|
};
|
|
1201
|
-
floatingFilterConfig: {
|
|
1202
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FloatingFilterConfig<any>>;
|
|
1203
|
-
};
|
|
1204
1174
|
radioConfig: {
|
|
1205
1175
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.RadioConfig<any>>;
|
|
1206
1176
|
};
|
|
1207
1177
|
checkboxConfig: {
|
|
1208
1178
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.CheckboxConfig<any>>;
|
|
1209
1179
|
};
|
|
1210
|
-
headerTooltipConfig: {
|
|
1211
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.HeaderTooltipConfig<any>>;
|
|
1212
|
-
};
|
|
1213
1180
|
tooltipConfig: {
|
|
1214
1181
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.TooltipConfig<any>>;
|
|
1215
1182
|
};
|
|
1216
|
-
footerTooltipConfig: {
|
|
1217
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FooterTooltipConfig<any>>;
|
|
1218
|
-
};
|
|
1219
1183
|
exportConfig: {
|
|
1220
1184
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.ExportConfig>;
|
|
1221
1185
|
};
|
|
@@ -1917,18 +1881,9 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1917
1881
|
footerCellStyle: {
|
|
1918
1882
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FooterCellStyle<any>>;
|
|
1919
1883
|
};
|
|
1920
|
-
showCustomHeader: {
|
|
1921
|
-
type: import("vue").PropType<boolean>;
|
|
1922
|
-
};
|
|
1923
|
-
mergeHeaderCells: {
|
|
1924
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeHeaderCells>;
|
|
1925
|
-
};
|
|
1926
1884
|
mergeCells: {
|
|
1927
1885
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeCells<any>>;
|
|
1928
1886
|
};
|
|
1929
|
-
mergeFooterCells: {
|
|
1930
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeFooterCells<any>>;
|
|
1931
|
-
};
|
|
1932
1887
|
mergeFooterItems: {
|
|
1933
1888
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.MergeFooterItems<any>>;
|
|
1934
1889
|
};
|
|
@@ -2010,24 +1965,15 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
2010
1965
|
filterConfig: {
|
|
2011
1966
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FilterConfig<any>>;
|
|
2012
1967
|
};
|
|
2013
|
-
floatingFilterConfig: {
|
|
2014
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FloatingFilterConfig<any>>;
|
|
2015
|
-
};
|
|
2016
1968
|
radioConfig: {
|
|
2017
1969
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.RadioConfig<any>>;
|
|
2018
1970
|
};
|
|
2019
1971
|
checkboxConfig: {
|
|
2020
1972
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.CheckboxConfig<any>>;
|
|
2021
1973
|
};
|
|
2022
|
-
headerTooltipConfig: {
|
|
2023
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.HeaderTooltipConfig<any>>;
|
|
2024
|
-
};
|
|
2025
1974
|
tooltipConfig: {
|
|
2026
1975
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.TooltipConfig<any>>;
|
|
2027
1976
|
};
|
|
2028
|
-
footerTooltipConfig: {
|
|
2029
|
-
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.FooterTooltipConfig<any>>;
|
|
2030
|
-
};
|
|
2031
1977
|
exportConfig: {
|
|
2032
1978
|
type: import("vue").PropType<import("vxe-table").VxeTablePropTypes.ExportConfig>;
|
|
2033
1979
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as N, useAttrs as
|
|
1
|
+
import { defineComponent as N, useAttrs as ae, ref as s, getCurrentInstance as te, computed as P, unref as e, watch as oe, nextTick as le, toRaw as re, createBlock as f, openBlock as m, withCtx as c, createElementVNode as D, normalizeClass as ne, createVNode as p, createCommentVNode as H, mergeProps as _, withDirectives as ce, renderSlot as h, normalizeProps as ie, guardReactiveProps as se } from "vue";
|
|
2
2
|
import { VftEmpty as ge } from "../empty/index.js";
|
|
3
3
|
import { vLoading as de } from "../loading/directive.js";
|
|
4
|
-
import { deepMerge as
|
|
4
|
+
import { deepMerge as F, isClient as ue, omit as fe, isFunction as me } from "@vft/utils";
|
|
5
5
|
import { FormCompEnum as pe } from "../../utils/form-register.js";
|
|
6
6
|
import "@vueuse/core";
|
|
7
7
|
import "../config-provider/hooks/use-global-config.js";
|
|
@@ -18,25 +18,25 @@ import { VftSkeleton as we } from "../skeleton/index.js";
|
|
|
18
18
|
import { VftSuperForm as ve } from "../super-form/index.js";
|
|
19
19
|
import { VxeGrid as ke } from "vxe-table";
|
|
20
20
|
import xe from "xe-utils";
|
|
21
|
-
import { PageSize as
|
|
21
|
+
import { PageSize as T } from "./constants.js";
|
|
22
22
|
import { useColumns as Se } from "./use/use-columns.js";
|
|
23
23
|
import { useDataSource as Be } from "./use/use-data-source.js";
|
|
24
24
|
import { useLoading as Re } from "./use/use-loading.js";
|
|
25
25
|
import { usePagination as ze } from "./use/use-pagination.js";
|
|
26
26
|
import { EmptyEnum as Pe } from "../empty/constants.js";
|
|
27
|
-
const
|
|
27
|
+
const De = {
|
|
28
28
|
"vft-loading-text": "加载中..."
|
|
29
|
-
},
|
|
29
|
+
}, He = N({
|
|
30
30
|
name: "vft-table"
|
|
31
|
-
}),
|
|
32
|
-
...
|
|
31
|
+
}), la = /* @__PURE__ */ N({
|
|
32
|
+
...He,
|
|
33
33
|
props: {
|
|
34
34
|
sticky: {
|
|
35
35
|
type: [Boolean, Object]
|
|
36
36
|
},
|
|
37
37
|
api: {},
|
|
38
38
|
pageSize: {
|
|
39
|
-
default:
|
|
39
|
+
default: T
|
|
40
40
|
},
|
|
41
41
|
total: {},
|
|
42
42
|
rowkey: {
|
|
@@ -146,12 +146,7 @@ const He = {
|
|
|
146
146
|
headerRowStyle: {},
|
|
147
147
|
footerRowStyle: {},
|
|
148
148
|
footerCellStyle: {},
|
|
149
|
-
showCustomHeader: {
|
|
150
|
-
type: Boolean
|
|
151
|
-
},
|
|
152
|
-
mergeHeaderCells: {},
|
|
153
149
|
mergeCells: {},
|
|
154
|
-
mergeFooterCells: {},
|
|
155
150
|
mergeFooterItems: {},
|
|
156
151
|
spanMethod: {},
|
|
157
152
|
footerSpanMethod: {},
|
|
@@ -205,12 +200,9 @@ const He = {
|
|
|
205
200
|
seqConfig: {},
|
|
206
201
|
sortConfig: {},
|
|
207
202
|
filterConfig: {},
|
|
208
|
-
floatingFilterConfig: {},
|
|
209
203
|
radioConfig: {},
|
|
210
204
|
checkboxConfig: {},
|
|
211
|
-
headerTooltipConfig: {},
|
|
212
205
|
tooltipConfig: {},
|
|
213
|
-
footerTooltipConfig: {},
|
|
214
206
|
exportConfig: {},
|
|
215
207
|
importConfig: {},
|
|
216
208
|
printConfig: {},
|
|
@@ -397,36 +389,36 @@ const He = {
|
|
|
397
389
|
"toolbar-tool-click",
|
|
398
390
|
"zoom"
|
|
399
391
|
],
|
|
400
|
-
setup(
|
|
392
|
+
setup(_e, {
|
|
401
393
|
expose: A,
|
|
402
394
|
emit: E
|
|
403
395
|
}) {
|
|
404
|
-
const l = E, g = be("table"), O =
|
|
396
|
+
const l = E, g = be("table"), O = ae(), b = s(), C = s(), V = s([]), d = s(), $ = te(), t = P(() => F($.props, e(d))), {
|
|
405
397
|
getLoading: q,
|
|
406
398
|
setLoading: G
|
|
407
|
-
} = Re(
|
|
399
|
+
} = Re(t), {
|
|
408
400
|
getPaginationInfo: i,
|
|
409
|
-
setPagination:
|
|
401
|
+
setPagination: u,
|
|
410
402
|
getCurrentPage: I
|
|
411
|
-
} = ze(
|
|
403
|
+
} = ze(t), {
|
|
412
404
|
getViewColumns: K,
|
|
413
405
|
setColumns: L
|
|
414
|
-
} = Se(
|
|
415
|
-
|
|
406
|
+
} = Se(t);
|
|
407
|
+
oe(() => I(), (a) => {
|
|
416
408
|
le(() => {
|
|
417
409
|
y({
|
|
418
410
|
seqConfig: {
|
|
419
|
-
startIndex: (
|
|
411
|
+
startIndex: (a - 1) * (i.value?.pageSize || e(t).pageSize || T)
|
|
420
412
|
}
|
|
421
413
|
});
|
|
422
414
|
});
|
|
423
415
|
}, {
|
|
424
416
|
immediate: !0
|
|
425
417
|
});
|
|
426
|
-
function y(
|
|
418
|
+
function y(a) {
|
|
427
419
|
d.value = {
|
|
428
420
|
...e(d),
|
|
429
|
-
...
|
|
421
|
+
...a
|
|
430
422
|
};
|
|
431
423
|
}
|
|
432
424
|
const {
|
|
@@ -441,20 +433,20 @@ const He = {
|
|
|
441
433
|
getDataSource: J,
|
|
442
434
|
getRawDataSource: k,
|
|
443
435
|
tableSearch: x
|
|
444
|
-
} = Be(
|
|
436
|
+
} = Be(t, {
|
|
445
437
|
tableData: V,
|
|
446
438
|
setLoading: G,
|
|
447
439
|
getPaginationInfo: i,
|
|
448
|
-
setPagination:
|
|
440
|
+
setPagination: u
|
|
449
441
|
}, l);
|
|
450
|
-
function S(
|
|
451
|
-
|
|
442
|
+
function S(a) {
|
|
443
|
+
a?.pageSize && u({
|
|
452
444
|
currentPage: 1
|
|
453
|
-
}), M(
|
|
445
|
+
}), M(a), l("change", a);
|
|
454
446
|
const {
|
|
455
|
-
onChange:
|
|
456
|
-
} = e(
|
|
457
|
-
|
|
447
|
+
onChange: o
|
|
448
|
+
} = e(t);
|
|
449
|
+
o && me(o) && o(a);
|
|
458
450
|
}
|
|
459
451
|
const B = {};
|
|
460
452
|
[
|
|
@@ -577,22 +569,22 @@ const He = {
|
|
|
577
569
|
"toolbar-button-click",
|
|
578
570
|
"toolbar-tool-click",
|
|
579
571
|
"zoom"
|
|
580
|
-
].forEach((
|
|
581
|
-
const
|
|
582
|
-
B[
|
|
572
|
+
].forEach((a) => {
|
|
573
|
+
const o = xe.camelCase(`on-${a}`);
|
|
574
|
+
B[o] = (...n) => l(a, ...n);
|
|
583
575
|
});
|
|
584
576
|
const r = P(() => {
|
|
585
|
-
const
|
|
577
|
+
const a = e(w), o = {
|
|
586
578
|
...O,
|
|
587
|
-
...e(
|
|
579
|
+
...e(t),
|
|
588
580
|
columns: re(e(K)),
|
|
589
581
|
loading: e(q),
|
|
590
|
-
data:
|
|
582
|
+
data: a,
|
|
591
583
|
...B
|
|
592
584
|
};
|
|
593
|
-
return
|
|
585
|
+
return ue && (o.maxHeight = e(t)?.maxHeight ? e(t)?.maxHeight : `${window.innerHeight - e(t)?.extraSysHeight - (t.value?.showPager ? t.value?.pageHeight || 40 : 0)}px`, o.minHeight = e(t)?.toolbarConfig?.custom ? 300 : e(t)?.minHeight), o;
|
|
594
586
|
}), R = {
|
|
595
|
-
setPagination:
|
|
587
|
+
setPagination: u,
|
|
596
588
|
emit: l,
|
|
597
589
|
setProps: y,
|
|
598
590
|
reload: X,
|
|
@@ -613,13 +605,13 @@ const He = {
|
|
|
613
605
|
label: "",
|
|
614
606
|
type: pe.SEARCH,
|
|
615
607
|
componentProps: ({}) => ({
|
|
616
|
-
onChange: (
|
|
608
|
+
onChange: (a) => {
|
|
617
609
|
z({
|
|
618
|
-
_filterTableData:
|
|
610
|
+
_filterTableData: a
|
|
619
611
|
});
|
|
620
612
|
}
|
|
621
613
|
})
|
|
622
|
-
}, [Z] = he(
|
|
614
|
+
}, [Z] = he(F({
|
|
623
615
|
schemas: [r.value?.formOptions?.addSearchAllSchema ? Q : {}],
|
|
624
616
|
rowProps: {
|
|
625
617
|
justify: "start"
|
|
@@ -634,12 +626,12 @@ const He = {
|
|
|
634
626
|
btnText: "搜索"
|
|
635
627
|
},
|
|
636
628
|
actionInline: !0
|
|
637
|
-
},
|
|
629
|
+
}, fe(
|
|
638
630
|
r.value?.formOptions,
|
|
639
631
|
["showActionForm", "addSearchAllSchema"]
|
|
640
632
|
// 'union' | 'intersection' | 'concat' | 'replace' = 'union'
|
|
641
|
-
), "replace")), z = (
|
|
642
|
-
Reflect.has(
|
|
633
|
+
), "replace")), z = (a) => {
|
|
634
|
+
Reflect.has(a, "_filterTableData") && x(a._filterTableData), l("form-submit", a);
|
|
643
635
|
}, ee = () => {
|
|
644
636
|
v(k()), l("form-reset");
|
|
645
637
|
};
|
|
@@ -647,40 +639,40 @@ const He = {
|
|
|
647
639
|
table: b,
|
|
648
640
|
pageRef: C,
|
|
649
641
|
...R
|
|
650
|
-
}), (
|
|
642
|
+
}), (a, o) => (m(), f(e(Ce), null, {
|
|
651
643
|
fallback: c(() => [p(e(we))]),
|
|
652
|
-
default: c(() => [
|
|
644
|
+
default: c(() => [D("div", {
|
|
653
645
|
class: ne([e(g).b()])
|
|
654
|
-
}, [p(e(ke),
|
|
646
|
+
}, [p(e(ke), _({
|
|
655
647
|
ref_key: "xGrid",
|
|
656
648
|
ref: b
|
|
657
649
|
}, r.value), {
|
|
658
|
-
toolbarButtons: c(() => [h(
|
|
650
|
+
toolbarButtons: c(() => [h(a.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (m(), f(e(ve), {
|
|
659
651
|
key: 0,
|
|
660
652
|
onRegister: e(Z),
|
|
661
653
|
onSubmit: z,
|
|
662
654
|
onReset: ee
|
|
663
|
-
}, null, 8, ["onRegister"])) :
|
|
664
|
-
empty: c(() => [h(
|
|
665
|
-
loading: c(() => [ce(
|
|
655
|
+
}, null, 8, ["onRegister"])) : H("", !0), h(a.$slots, "toolbar-right")]),
|
|
656
|
+
empty: c(() => [h(a.$slots, "empty", {}, () => [p(e(ge), ie(se(r.value.emptyCfg)), null, 16)])]),
|
|
657
|
+
loading: c(() => [ce(D("div", De, null, 512), [[e(de), !!r.value.loading]])]),
|
|
666
658
|
_: 3
|
|
667
|
-
}, 16), r.value.showPager ? (m(),
|
|
659
|
+
}, 16), r.value.showPager ? (m(), f(e(ye), _({
|
|
668
660
|
key: 0,
|
|
669
661
|
ref_key: "pageRef",
|
|
670
662
|
ref: C
|
|
671
663
|
}, e(i), {
|
|
672
664
|
class: [e(g).e("pager"), e(g).m(`pager-${e(i)?.pagePlacement}`)],
|
|
673
|
-
onCurrentChange:
|
|
665
|
+
onCurrentChange: o[0] || (o[0] = (n) => S({
|
|
674
666
|
currentPage: n
|
|
675
667
|
})),
|
|
676
|
-
onSizeChange:
|
|
668
|
+
onSizeChange: o[1] || (o[1] = (n) => S({
|
|
677
669
|
pageSize: n
|
|
678
670
|
}))
|
|
679
|
-
}), null, 16, ["class"])) :
|
|
671
|
+
}), null, 16, ["class"])) : H("", !0)], 2)]),
|
|
680
672
|
_: 3
|
|
681
673
|
}));
|
|
682
674
|
}
|
|
683
675
|
});
|
|
684
676
|
export {
|
|
685
|
-
|
|
677
|
+
la as default
|
|
686
678
|
};
|
package/es/package.json.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"name": "vft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.442",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -43,9 +43,9 @@ declare const _default: {
|
|
|
43
43
|
"vue-router": ">=4.0.16"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"vxe-
|
|
47
|
-
"vxe-
|
|
48
|
-
"xe-utils": "3.7.
|
|
46
|
+
"vxe-pc-ui": "4.8.12",
|
|
47
|
+
"vxe-table": "4.15.0",
|
|
48
|
+
"xe-utils": "3.7.8",
|
|
49
49
|
"@vft/constants": "workspace:*",
|
|
50
50
|
"@vft/router": "workspace:*",
|
|
51
51
|
"@vft/store": "workspace:*",
|
package/es/package.json.js
CHANGED
package/es/utils/vue/vnode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isArray as E, hasOwn as m, camelize as N } from "@vft/utils";
|
|
2
2
|
import { isVNode as o, Fragment as S, Comment as A, Text as s, createCommentVNode as L, createBlock as _, openBlock as C } from "vue";
|
|
3
3
|
import { debugWarn as O } from "../error.js";
|
|
4
4
|
const R = "utils/vue/vnode";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const b=require("../icon/index.cjs"),Y=require("@vueuse/core"),s=require("@vft/utils"),T=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");const Be=require("lodash-es"),Z=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const q=require("@vft/constants"),_=require("@vft/use"),ee=require("./utils.cjs"),te=require("../form/hooks/use-form-item.cjs"),ne=require("../form/hooks/use-form-common-props.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=te.useFormItem(),{inputId:F}=te.useFormItemInputId(se.props,{formItemContext:k}),ie=ne.useFormSize(),m=ne.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{let a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const b=require("../icon/index.cjs"),Y=require("@vueuse/core"),s=require("@vft/utils"),T=require("../../utils/error.cjs");require("../config-provider/hooks/use-global-config.cjs");const Be=require("lodash-es"),Z=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const q=require("@vft/constants"),_=require("@vft/use"),ee=require("./utils.cjs"),te=require("../form/hooks/use-form-common-props.cjs"),ne=require("../form/hooks/use-form-item.cjs"),Ve=["role"],Ie=["id","type","disabled","formatter","parser","readonly","autocomplete","tabindex","aria-label","placeholder","form"],Se=["id","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form"],ze=e.defineComponent({__name:"input",props:{id:{},size:{default:""},disabled:{type:Boolean},modelValue:{},type:{default:"text"},resize:{},autosize:{type:[Object,Boolean],default:!1},autocomplete:{default:"off"},formatter:{},parser:{},placeholder:{},form:{},readonly:{type:Boolean},clearable:{type:Boolean},showPassword:{type:Boolean},showWordLimit:{type:Boolean},suffixIcon:{},prefixIcon:{},clearIcon:{},containerRole:{},label:{},tabindex:{default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:[Boolean,null,String,Object,Array]}},emits:{[q.UPDATE_MODEL_EVENT]:t=>s.isString(t),input:t=>s.isString(t),change:t=>s.isString(t),suffixClick:t=>s.isString(t),prefixClick:t=>s.isString(t),focus:t=>t instanceof FocusEvent,blur:t=>t instanceof FocusEvent,clear:()=>!0,enter:()=>!0,mouseleave:t=>t instanceof MouseEvent,mouseenter:t=>t instanceof MouseEvent,keydown:t=>t instanceof Event,compositionstart:t=>t instanceof CompositionEvent,compositionupdate:t=>t instanceof CompositionEvent,compositionend:t=>t instanceof CompositionEvent},setup(t,{expose:oe,emit:ae}){const l=ae,p=e.useAttrs(),i=e.useSlots(),M=e.computed(()=>{const n={};return t.containerRole==="combobox"&&(n["aria-haspopup"]=p["aria-haspopup"],n["aria-owns"]=p["aria-owns"],n["aria-expanded"]=p["aria-expanded"]),n}),le=e.computed(()=>[t.type==="textarea"?A.b():o.b(),o.m(ie.value),o.is("disabled",m.value),o.is("exceed",fe.value),o.is("focus",c.value),{[o.b("group")]:i.prepend||i.append,[o.bm("group","append")]:i.append,[o.bm("group","prepend")]:i.prepend,[o.m("prefix")]:i.prefix||t.prefixIcon,[o.m("suffix")]:i.suffix||t.suffixIcon||t.clearable||t.showPassword,[o.bm("suffix","password-clear")]:E.value&&z.value},p.class]),se=e.getCurrentInstance(),re=e.computed(()=>[o.e("wrapper"),o.is("focus",c.value)]),r=_.useAttrs({excludeKeys:e.computed(()=>Object.keys(M.value))}),{form:ue,formItem:k}=ne.useFormItem(),{inputId:F}=ne.useFormItemInputId(se.props,{formItemContext:k}),ie=te.useFormSize(),m=te.useFormDisabled(),o=Z.useNamespace("input"),A=Z.useNamespace("textarea"),C=e.shallowRef(),f=e.shallowRef(),c=e.ref(!1),V=e.ref(!1),y=e.ref(!1),w=e.ref(!1),D=e.ref(),I=e.shallowRef(t.inputStyle),h=e.computed(()=>C.value||f.value),S=e.computed(()=>s.singleAttrToObj(t.prefixIcon,"icon",{size:16})),O=e.computed(()=>s.singleAttrToObj(t.suffixIcon,"icon",{size:16})),ce=e.computed(()=>s.singleAttrToObj(t.clearIcon,"icon",{icon:"icon-circle-close",size:16})),R=e.computed(()=>ue?.statusIcon??!1),x=e.computed(()=>k?.validateState||""),K=e.computed(()=>x.value&&{validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"}[x.value]),de=e.computed(()=>w.value?{icon:"icon-view",size:16}:{icon:"icon-hide",size:16}),me=e.computed(()=>[p.style,t.inputStyle]),$=e.computed(()=>[t.inputStyle,I.value,{resize:t.resize}]),u=e.computed(()=>Be.isNil(t.modelValue)?"":String(t.modelValue)),E=e.computed(()=>t.clearable&&!m.value&&!t.readonly&&!!u.value&&(c.value||V.value)),z=e.computed(()=>t.showPassword&&!m.value&&!t.readonly&&!!u.value&&(!!u.value||c.value)),v=e.computed(()=>t.showWordLimit&&!!r.value.maxlength&&(t.type==="text"||t.type==="textarea")&&!m.value&&!t.readonly&&!t.showPassword),N=e.computed(()=>Array.from(u.value).length),fe=e.computed(()=>!!v.value&&N.value>Number(r.value.maxlength)),ve=e.computed(()=>!!i.suffix||!!t.suffixIcon||E.value||t.showPassword||v.value||!!x.value&&R.value),[pe,ye]=_.useCursor(C);Y.useResizeObserver(f,n=>{if(!v.value||t.resize!=="both")return;const a=n[0],{width:d}=a.contentRect;D.value={right:`calc(100% - ${d+15+6}px)`}});const B=()=>{if(!(!Y.isClient||t.type!=="textarea"))if(t.autosize){const n=s.isObject(t.autosize)?t.autosize.minRows:void 0,a=s.isObject(t.autosize)?t.autosize.maxRows:void 0;I.value={...ee.calcTextareaHeight(f.value,n,a)}}else I.value={minHeight:ee.calcTextareaHeight(f.value).minHeight}},g=()=>{const n=h.value;!n||n.value===u.value||(n.value=u.value)},P=async n=>{pe();let{value:a}=n.target;if(r.value.maxlength&&a.length>=r.value.maxlength&&(a=a.slice(0,Number(r.value.maxlength))),t.formatter&&(a=t.parser?t.parser(a):a,a=t.formatter(a)),!y.value){if(a===u.value){g();return}l(q.UPDATE_MODEL_EVENT,a),l("input",a),await e.nextTick(),g(),ye()}},j=n=>{l("change",n.target.value)},he=()=>{l("suffixClick",t.modelValue)},xe=()=>{l("prefixClick",t.modelValue)},L=n=>{l("compositionstart",n),y.value=!0},ge=n=>/([(\uAC00-\uD7AF)|\u3130-\u318F])+/.test(n),W=n=>{l("compositionupdate",n);const a=n.target?.value,d=a[a.length-1]||"";y.value=!ge(d)},H=n=>{l("compositionend",n),y.value&&(y.value=!1,P(n))},be=()=>{w.value=!w.value,U()},U=async()=>{await e.nextTick(),h.value?.focus()},ke=()=>h.value?.blur(),G=n=>{c.value=!0,l("focus",n)},J=n=>{c.value=!1,l("blur",n),t.validateEvent&&k?.validate?.("blur").catch(a=>T.debugWarn(a))},Ce=n=>{V.value=!1,l("mouseleave",n)},we=n=>{V.value=!0,l("mouseenter",n)},Q=n=>{let a=n.key;if(n.target.type==="number"&&["e","+","-0","E"].includes(a))return n.returnValue=!1,!1;l("keydown",n)},Ee=()=>{h.value?.select()},X=()=>{l(q.UPDATE_MODEL_EVENT,""),l("change",""),l("clear"),l("input","")};return e.watch(()=>t.modelValue,()=>{e.nextTick(()=>B()),t.validateEvent&&k?.validate?.("change").catch(n=>T.debugWarn(n))}),e.watch(u,()=>g()),e.watch(()=>t.type,async()=>{await e.nextTick(),g(),B()}),e.onMounted(()=>{!t.formatter&&t.parser&&T.debugWarn("VftInput","If you set the parser, you also need to set the formatter."),g(),e.nextTick(B)}),oe({input:C,textarea:f,ref:h,textareaStyle:$,autosize:t.autosize,focus:U,blur:ke,select:Ee,clear:X,resizeTextarea:B}),(n,a)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",e.mergeProps(M.value,{class:le.value,style:me.value,role:t.containerRole,onMouseenter:we,onMouseleave:Ce,onMousewheel:a[1]||(a[1]=d=>t.type==="number"&&c.value?d.preventDefault():null)}),[t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o).be("group","prepend"))},[e.renderSlot(n.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(re.value)},[n.$slots.prefix||S.value?.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(o).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("prefix-inner")),onClick:xe},[e.renderSlot(n.$slots,"prefix"),S.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0,pointer:""},S.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(F),ref_key:"input",ref:C,class:e.unref(o).e("inner")},e.unref(r),{type:t.showPassword?w.value?"text":"password":t.type,disabled:e.unref(m),formatter:t.formatter,parser:t.parser,readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.label,placeholder:t.placeholder,style:t.inputStyle,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q,onKeyup:a[0]||(a[0]=e.withKeys(d=>l("enter"),["enter"]))}),null,16,Ie),ve.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(o).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("suffix-inner")),onClick:he},[!E.value||!z.value||!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(n.$slots,"suffix"),O.value?.icon?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:0},O.value,{class:e.unref(o).e("icon")}),null,16,["class"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:1,pointer:"",class:[e.unref(o).e("icon"),e.unref(o).e("clear")]},ce.value,{onMousedown:e.withModifiers(e.unref(s.noop),["prevent"]),onClick:e.withModifiers(X,["stop"])}),null,16,["class","onMousedown"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),e.mergeProps({key:2},de.value,{class:[e.unref(o).e("icon"),e.unref(o).e("password")],onClick:be}),null,16,["class"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(o).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(o).e("count-inner"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),3)],2)):e.createCommentVNode("",!0),x.value&&K.value&&R.value?(e.openBlock(),e.createBlock(e.unref(b.VftIcon),{key:4,icon:K.value,class:e.normalizeClass([e.unref(o).e("icon"),e.unref(o).e("validateIcon"),e.unref(o).is("loading",x.value==="validating")])},null,8,["icon","class"])):e.createCommentVNode("",!0)],2)],2)):e.createCommentVNode("",!0)],2),n.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o).be("group","append"))},[e.renderSlot(n.$slots,"append")],2)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("textarea",e.mergeProps({id:e.unref(F),ref_key:"textarea",ref:f,class:e.unref(A).e("inner")},e.unref(r),{tabindex:t.tabindex,disabled:e.unref(m),readonly:t.readonly,autocomplete:t.autocomplete,style:$.value,"aria-label":t.label,placeholder:t.placeholder,form:t.form,onCompositionstart:L,onCompositionupdate:W,onCompositionend:H,onInput:P,onFocus:G,onBlur:J,onChange:j,onKeydown:Q}),null,16,Se),v.value?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(D.value),class:e.normalizeClass(e.unref(o).e("count"))},e.toDisplayString(N.value)+" / "+e.toDisplayString(e.unref(r).maxlength),7)):e.createCommentVNode("",!0)],64))],16,Ve)),[[e.vShow,t.type!=="hidden"]])}});exports.default=ze;
|