@kayak-sj/design 1.0.49 → 1.0.51

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.
Files changed (41) hide show
  1. package/dist/assets/Complex-2LP9XsDR.css +1 -0
  2. package/dist/assets/{components-crJ55-Y9.css → componentRegistry-BhoC2OWH.css} +1 -1
  3. package/dist/assets/index-Biv6Btn_.css +1 -0
  4. package/dist/chunks/{Complex-C7w3K3P5.js → Complex-CijuFsnI.js} +3 -3
  5. package/dist/chunks/componentRegistry-BCjeWYov.js +2389 -0
  6. package/dist/components/k-editor/utils/editorValue.d.ts +50 -10
  7. package/dist/components/k-form/composables/useFormSchema.d.ts +16 -0
  8. package/dist/components/k-form/composables/useKFormFields.d.ts +7 -2
  9. package/dist/components/k-form/composables/useKFormModel.d.ts +20 -3
  10. package/dist/components/k-form/composables/useKFormTemplateRef.d.ts +4 -0
  11. package/dist/components/k-form/formComponent/componentRegistry.d.ts +10 -3
  12. package/dist/components/k-form/utils/fieldValue.d.ts +51 -4
  13. package/dist/components/k-form/utils/formRules.d.ts +6 -0
  14. package/dist/components/k-form/utils/resolveFormFieldComponent.d.ts +15 -2
  15. package/dist/components/k-handle-page/useHandlePageInit.d.ts +13 -1
  16. package/dist/components/k-icon/resolveLucideIcon.d.ts +23 -4
  17. package/dist/components/k-table/composables/useColumnDisplay.d.ts +4 -0
  18. package/dist/components/k-table/composables/useKTable.d.ts +27 -2
  19. package/dist/components/k-table/composables/useKTableCrossPageSelection.d.ts +26 -0
  20. package/dist/components/k-table/composables/useKTableTemplateRef.d.ts +10 -0
  21. package/dist/components/k-table/composables/useTableColumns.d.ts +14 -2
  22. package/dist/components/k-table/composables/useTableData.d.ts +28 -5
  23. package/dist/components/k-table/composables/useTablePagination.d.ts +3 -0
  24. package/dist/components/k-table/composables/useTableRadio.d.ts +9 -0
  25. package/dist/components/k-table/composables/useTableRowSort.d.ts +9 -0
  26. package/dist/components/k-table/composables/useTableTreeLoad.d.ts +12 -0
  27. package/dist/components/k-table/dictOptions.d.ts +6 -1
  28. package/dist/components/k-table/report/exportKTableReport.d.ts +30 -5
  29. package/dist/components/k-table/types.d.ts +4 -0
  30. package/dist/components/k-upload/utils/uploadFileValue.d.ts +40 -12
  31. package/dist/config/uploadConfig.d.ts +11 -0
  32. package/dist/index.d.ts +5 -1
  33. package/dist/index.js +2641 -50
  34. package/dist/theme/index.d.ts +7 -3
  35. package/dist/utils/createStubComponent.d.ts +12 -1
  36. package/dist/utils/validators.d.ts +38 -6
  37. package/package.json +2 -7
  38. package/src/styles/components/_k-handle-page.scss +7 -4
  39. package/dist/assets/Complex-DIKmdv9F.css +0 -1
  40. package/dist/chunks/components-MlPbHyef.js +0 -4976
  41. package/dist/components/index.js +0 -3
@@ -0,0 +1,2389 @@
1
+ import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
+ import { u as t } from "./editorValue-DSKvW8ty.js";
3
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createSlots as c, createTextVNode as l, createVNode as u, defineAsyncComponent as d, defineComponent as f, guardReactiveProps as p, inject as m, isRef as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeProps as b, normalizeStyle as x, openBlock as S, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useAttrs as k, useModel as A, useSlots as j, useTemplateRef as ee, vShow as te, watch as M, withCtx as N, withDirectives as ne, withModifiers as P } from "vue";
4
+ import { ElButton as F, ElCascader as re, ElCheckbox as ie, ElCheckboxGroup as I, ElDatePicker as ae, ElDialog as L, ElIcon as R, ElImageViewer as oe, ElInput as z, ElInputNumber as B, ElMessage as V, ElOption as H, ElProgress as se, ElRadio as ce, ElRadioButton as le, ElRadioGroup as ue, ElSelect as U, ElTag as de, ElTimePicker as fe, ElTooltip as pe, ElTreeSelect as me, ElUpload as he } from "element-plus";
5
+ import W from "dayjs";
6
+ import { cloneDeep as G } from "lodash-es";
7
+ import { useDebounceFn as ge, useEventListener as K } from "@vueuse/core";
8
+ import { Delete as _e, Download as ve, Plus as ye, VideoPlay as be, ZoomIn as xe } from "@element-plus/icons-vue";
9
+ import '../assets/componentRegistry-BhoC2OWH.css';//#endregion
10
+ //#region src/components/k-button/KButton.vue
11
+ var q = /* @__PURE__ */ f({
12
+ name: "KButton",
13
+ __name: "KButton",
14
+ setup(e) {
15
+ return (e, t) => (S(), i(O(F), b(p(e.$attrs)), {
16
+ default: N(() => [T(e.$slots, "default")]),
17
+ _: 3
18
+ }, 16));
19
+ }
20
+ }), Se = { class: "k-dialog-header" }, Ce = {
21
+ key: 0,
22
+ class: "k-dialog-header__badge",
23
+ "aria-hidden": "true"
24
+ }, J = { class: "k-dialog-header__text" }, we = {
25
+ key: 0,
26
+ class: "k-dialog-header__title"
27
+ }, Te = {
28
+ key: 1,
29
+ class: "k-dialog-header__desc"
30
+ }, Ee = {
31
+ key: 1,
32
+ class: "k-dialog-header__extra"
33
+ }, De = /* @__PURE__ */ f({
34
+ name: "KDialogHeader",
35
+ __name: "KDialogHeader",
36
+ props: {
37
+ title: { default: "" },
38
+ description: { default: "" },
39
+ icon: {},
40
+ iconSize: { default: 22 }
41
+ },
42
+ setup(e) {
43
+ return (t, n) => (S(), o("div", Se, [
44
+ e.icon || t.$slots.icon ? (S(), o("div", Ce, [T(t.$slots, "icon", {}, () => [(S(), i(E(e.icon), {
45
+ class: "k-dialog-header__icon",
46
+ size: e.iconSize,
47
+ "stroke-width": 2.2
48
+ }, null, 8, ["size"]))])])) : a("", !0),
49
+ s("div", J, [
50
+ e.title || t.$slots.title ? (S(), o("p", we, [T(t.$slots, "title", {}, () => [l(D(e.title), 1)])])) : a("", !0),
51
+ e.description || t.$slots.description ? (S(), o("p", Te, [T(t.$slots, "description", {}, () => [l(D(e.description), 1)])])) : a("", !0),
52
+ T(t.$slots, "default")
53
+ ]),
54
+ t.$slots.extra ? (S(), o("div", Ee, [T(t.$slots, "extra")])) : a("", !0)
55
+ ]));
56
+ }
57
+ }), Oe = { class: "k-dialog__body" }, ke = /* @__PURE__ */ f({
58
+ name: "KDialog",
59
+ inheritAttrs: !1,
60
+ __name: "KDialog",
61
+ props: /*@__PURE__*/ g({
62
+ title: { default: "" },
63
+ description: { default: "" },
64
+ icon: { default: void 0 },
65
+ variant: { default: "default" },
66
+ showConfirm: {
67
+ type: [Boolean, String],
68
+ default: !0
69
+ },
70
+ showCancel: {
71
+ type: [Boolean, String],
72
+ default: !0
73
+ },
74
+ confirmLoading: {
75
+ type: Boolean,
76
+ default: !1
77
+ },
78
+ appendToBody: {
79
+ type: Boolean,
80
+ default: !0
81
+ },
82
+ showClose: {
83
+ type: Boolean,
84
+ default: !0
85
+ },
86
+ destroyOnClose: {
87
+ type: Boolean,
88
+ default: !0
89
+ }
90
+ }, {
91
+ visible: {
92
+ type: Boolean,
93
+ default: !1
94
+ },
95
+ visibleModifiers: {}
96
+ }),
97
+ emits: /*@__PURE__*/ g([
98
+ "confirm",
99
+ "cancel",
100
+ "closed"
101
+ ], ["update:visible"]),
102
+ setup(e, { emit: t }) {
103
+ let n = A(e, "visible"), o = e, d = t, f = k(), p = j(), m = r(() => o.variant === "hero"), h = r(() => m.value ? void 0 : o.title), g = r(() => [
104
+ "k-dialog",
105
+ m.value ? "k-dialog--hero" : void 0,
106
+ f.class
107
+ ]), v = r(() => {
108
+ let { class: e, ...t } = f;
109
+ return {
110
+ closeOnClickModal: !1,
111
+ appendToBody: o.appendToBody,
112
+ showClose: o.showClose,
113
+ destroyOnClose: o.destroyOnClose,
114
+ ...t
115
+ };
116
+ }), y = r(() => o.showConfirm === !0 ? "确定" : String(o.showConfirm)), b = r(() => o.showCancel === !0 ? "取消" : String(o.showCancel)), x = r(() => m.value && (!!p.header || !!o.title || !!o.description || !!o.icon || !!p.icon));
117
+ function C() {
118
+ n.value = !1;
119
+ }
120
+ function w() {
121
+ C(), d("cancel");
122
+ }
123
+ function E() {
124
+ d("confirm");
125
+ }
126
+ return (t, r) => (S(), i(O(L), _({
127
+ modelValue: n.value,
128
+ "onUpdate:modelValue": r[0] ||= (e) => n.value = e,
129
+ class: g.value,
130
+ title: h.value
131
+ }, v.value, { onClosed: r[1] ||= (e) => d("closed") }), c({
132
+ default: N(() => [s("div", Oe, [T(t.$slots, "default")])]),
133
+ _: 2
134
+ }, [x.value ? {
135
+ name: "header",
136
+ fn: N(() => [T(t.$slots, "header", {}, () => [u(De, {
137
+ title: e.title,
138
+ description: e.description,
139
+ icon: e.icon
140
+ }, c({ _: 2 }, [O(p).icon ? {
141
+ name: "icon",
142
+ fn: N(() => [T(t.$slots, "icon")]),
143
+ key: "0"
144
+ } : void 0]), 1032, [
145
+ "title",
146
+ "description",
147
+ "icon"
148
+ ])])]),
149
+ key: "0"
150
+ } : void 0, O(p).footer ? {
151
+ name: "footer",
152
+ fn: N(() => [T(t.$slots, "footer")]),
153
+ key: "1"
154
+ } : !O(p).footer && (e.showConfirm !== !1 || e.showCancel !== !1) ? {
155
+ name: "footer",
156
+ fn: N(() => [e.showCancel === !1 ? a("", !0) : (S(), i(q, {
157
+ key: 0,
158
+ onClick: w
159
+ }, {
160
+ default: N(() => [l(D(b.value), 1)]),
161
+ _: 1
162
+ })), e.showConfirm === !1 ? a("", !0) : (S(), i(q, {
163
+ key: 1,
164
+ type: "primary",
165
+ loading: e.confirmLoading,
166
+ onClick: E
167
+ }, {
168
+ default: N(() => [l(D(y.value), 1)]),
169
+ _: 1
170
+ }, 8, ["loading"]))]),
171
+ key: "2"
172
+ } : void 0]), 1040, [
173
+ "modelValue",
174
+ "class",
175
+ "title"
176
+ ]));
177
+ }
178
+ }), Ae = Symbol("kayak-dict"), je = {
179
+ list: "rows",
180
+ page: "page_no",
181
+ limit: "page_size",
182
+ total: "total"
183
+ }, Me = {
184
+ total: 0,
185
+ currentPage: 1,
186
+ pageSize: 10,
187
+ pageSizes: [
188
+ 10,
189
+ 20,
190
+ 30,
191
+ 100
192
+ ],
193
+ layout: "total, sizes, prev, pager, next, jumper"
194
+ }, Ne = Symbol("k-form-date-picker-values"), Pe = [
195
+ "year",
196
+ "month",
197
+ "date",
198
+ "dates",
199
+ "datetime",
200
+ "week",
201
+ "datetimerange",
202
+ "daterange",
203
+ "monthrange",
204
+ "yearrange"
205
+ ];
206
+ function Fe(e) {
207
+ return typeof e == "string" || typeof e == "number" ? e : String(e);
208
+ }
209
+ function Y(e) {
210
+ if (e != null) return typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? e : String(e);
211
+ }
212
+ function Ie(e) {
213
+ return e == null ? "" : String(e);
214
+ }
215
+ function X(e) {
216
+ return Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number") : [];
217
+ }
218
+ function Le(e) {
219
+ if (typeof e == "number" && !Number.isNaN(e)) return e;
220
+ if (e == null || e === "") return;
221
+ let t = Number(e);
222
+ return Number.isNaN(t) ? void 0 : t;
223
+ }
224
+ function Re(e) {
225
+ if (e != null) return e instanceof Date || typeof e == "string" || Array.isArray(e) && e.length === 2 && (e.every((e) => e instanceof Date) || e.every((e) => typeof e == "string")) ? e : String(e);
226
+ }
227
+ function ze(e) {
228
+ return e && Pe.includes(e) ? e : "date";
229
+ }
230
+ function Be(e) {
231
+ if (e != null && e !== "") return e instanceof Date || typeof e == "string" || Array.isArray(e) && e.length === 2 && (e.every((e) => e instanceof Date) || e.every((e) => typeof e == "string")) ? e : String(e);
232
+ }
233
+ function Ve(e) {
234
+ return e === "timerange" ? "timerange" : "time";
235
+ }
236
+ function He(e) {
237
+ return e == null || typeof e == "string" || typeof e == "number" ? e : Array.isArray(e) ? e.filter((e) => typeof e == "string" || typeof e == "number") : typeof e == "object" ? e : String(e);
238
+ }
239
+ function Ue(e) {
240
+ return Array.isArray(e) ? e : [];
241
+ }
242
+ function We(e, t) {
243
+ let n = Y(t);
244
+ if (n !== void 0) for (let t of e) {
245
+ let e = t.value ?? t.id;
246
+ if (e != null && String(e) === String(n)) {
247
+ let e = t.label;
248
+ return e == null ? void 0 : String(e);
249
+ }
250
+ let r = t.children;
251
+ if (Array.isArray(r)) {
252
+ let e = We(r, n);
253
+ if (e) return e;
254
+ }
255
+ }
256
+ }
257
+ function Ge(e, t, n, r = " / ") {
258
+ let i = He(t);
259
+ if (i == null || i === "") return Z(t);
260
+ let a = n?.value ?? "value", o = n?.label ?? "label", s = n?.children ?? "children", c = Array.isArray(i) ? i : [i], l = [], u = Array.isArray(e) ? e : [];
261
+ for (let e of c) {
262
+ let t = u.find((t) => t != null && String(t[a]) === String(e));
263
+ if (!t) return l.length ? [...l, ...c.slice(l.length).map(String)].join(r) : Z(Array.isArray(i) ? c.join(r) : i);
264
+ let n = t[o];
265
+ l.push(String(n != null && n !== "" ? n : e));
266
+ let d = t[s];
267
+ u = Array.isArray(d) ? d : [];
268
+ }
269
+ return l.length ? l.join(r) : Z(t);
270
+ }
271
+ function Z(e, t = "--") {
272
+ return e == null || e === "" ? t : String(e);
273
+ }
274
+ //#endregion
275
+ //#region src/components/k-form/formComponent/Cascader.vue?vue&type=script&setup=true&lang.ts
276
+ var Ke = {
277
+ key: 0,
278
+ class: "k-form-cascader__readonly"
279
+ }, qe = /*#__PURE__*/ e(/* @__PURE__ */ f({
280
+ name: "KFormCascader",
281
+ __name: "Cascader",
282
+ props: {
283
+ modelValue: {},
284
+ options: {},
285
+ readonly: { type: Boolean },
286
+ disabled: { type: Boolean },
287
+ props: {},
288
+ cascaderProps: {},
289
+ placeholder: {},
290
+ clearable: { type: Boolean },
291
+ separator: {}
292
+ },
293
+ emits: ["update:modelValue"],
294
+ setup(e, { emit: t }) {
295
+ let n = e, a = t, s = r(() => He(n.modelValue)), c = r(() => n.cascaderProps ?? n.props), l = r(() => Ge(n.options, n.modelValue, c.value, n.separator ?? " / "));
296
+ return (t, n) => e.readonly ? (S(), o("span", Ke, D(l.value), 1)) : (S(), i(O(re), {
297
+ key: 1,
298
+ "model-value": s.value,
299
+ options: e.options ?? [],
300
+ props: c.value,
301
+ placeholder: e.placeholder,
302
+ clearable: e.clearable ?? !0,
303
+ disabled: e.disabled,
304
+ "onUpdate:modelValue": n[0] ||= (e) => a("update:modelValue", e)
305
+ }, null, 8, [
306
+ "model-value",
307
+ "options",
308
+ "props",
309
+ "placeholder",
310
+ "clearable",
311
+ "disabled"
312
+ ]));
313
+ }
314
+ }), [["__scopeId", "data-v-ed0da536"]]), Je = { class: "k-form-checkbox" }, Ye = {
315
+ key: 0,
316
+ class: "k-form-checkbox__readonly"
317
+ }, Xe = /*#__PURE__*/ e(/* @__PURE__ */ f({
318
+ name: "KFormCheckbox",
319
+ __name: "CheckBox",
320
+ props: {
321
+ modelValue: {},
322
+ options: {},
323
+ readonly: { type: Boolean },
324
+ disabled: { type: Boolean },
325
+ showSelectAll: {
326
+ type: Boolean,
327
+ default: !1
328
+ }
329
+ },
330
+ emits: ["update:modelValue"],
331
+ setup(e, { emit: t }) {
332
+ function s(e) {
333
+ return e.tooltip ?? "";
334
+ }
335
+ function c(e) {
336
+ return s(e) === "";
337
+ }
338
+ let d = e, f = t, p = C([]), m = C(!1), h = C(!1), g = r(() => (d.options ?? []).map((e) => e.value)), _ = r(() => {
339
+ let e = (d.options ?? []).filter((e) => p.value.includes(e.value)).map((e) => e.label);
340
+ return e.length ? e.join(", ") : "--";
341
+ });
342
+ M(() => d.modelValue, (e) => {
343
+ p.value = X(e), v(p.value);
344
+ }, { immediate: !0 });
345
+ function v(e) {
346
+ let t = g.value.length, n = e.length;
347
+ m.value = t > 0 && n === t, h.value = n > 0 && n < t;
348
+ }
349
+ function y(e) {
350
+ let t = e === !0 ? [...g.value] : [];
351
+ p.value = t, h.value = !1, f("update:modelValue", t);
352
+ }
353
+ function b(e) {
354
+ p.value = e, v(e), f("update:modelValue", e);
355
+ }
356
+ return (t, r) => (S(), o("div", Je, [e.readonly ? (S(), o("span", Ye, D(_.value), 1)) : (S(), o(n, { key: 1 }, [e.showSelectAll ? (S(), i(O(ie), {
357
+ key: 0,
358
+ modelValue: m.value,
359
+ "onUpdate:modelValue": r[0] ||= (e) => m.value = e,
360
+ indeterminate: h.value,
361
+ disabled: e.disabled,
362
+ onChange: y
363
+ }, {
364
+ default: N(() => [...r[1] ||= [l(" 全选 ", -1)]]),
365
+ _: 1
366
+ }, 8, [
367
+ "modelValue",
368
+ "indeterminate",
369
+ "disabled"
370
+ ])) : a("", !0), u(O(I), {
371
+ "model-value": p.value,
372
+ disabled: e.disabled,
373
+ "onUpdate:modelValue": b
374
+ }, {
375
+ default: N(() => [(S(!0), o(n, null, w(e.options, (e) => (S(), i(O(pe), {
376
+ key: String(e.value),
377
+ content: s(e),
378
+ disabled: c(e),
379
+ placement: "top-start"
380
+ }, {
381
+ default: N(() => [u(O(ie), {
382
+ value: O(Y)(e.value),
383
+ disabled: e.disabled
384
+ }, {
385
+ default: N(() => [l(D(e.label), 1)]),
386
+ _: 2
387
+ }, 1032, ["value", "disabled"])]),
388
+ _: 2
389
+ }, 1032, ["content", "disabled"]))), 128))]),
390
+ _: 1
391
+ }, 8, ["model-value", "disabled"])], 64))]));
392
+ }
393
+ }), [["__scopeId", "data-v-fca64c11"]]), Ze = ["innerHTML"], Qe = {
394
+ key: 2,
395
+ class: "k-form-date-picker__readonly"
396
+ }, $e = ["innerHTML"], et = /*#__PURE__*/ e(/* @__PURE__ */ f({
397
+ name: "KFormDatePicker",
398
+ inheritAttrs: !1,
399
+ __name: "DatePicker",
400
+ props: {
401
+ modelValue: {},
402
+ options: {},
403
+ readonly: { type: Boolean },
404
+ disabled: { type: Boolean },
405
+ type: { default: "date" },
406
+ prepend: { default: "" },
407
+ append: { default: "" },
408
+ limitTime: {
409
+ type: Boolean,
410
+ default: !1
411
+ },
412
+ datePickerValues: { default: void 0 },
413
+ dateDisabled: {
414
+ type: [Array, Function],
415
+ default: void 0
416
+ },
417
+ minDate: {
418
+ type: [
419
+ String,
420
+ Date,
421
+ Function
422
+ ],
423
+ default: void 0
424
+ },
425
+ maxDate: {
426
+ type: [
427
+ String,
428
+ Date,
429
+ Function
430
+ ],
431
+ default: void 0
432
+ },
433
+ placeholder: { default: void 0 },
434
+ startPlaceholder: { default: void 0 },
435
+ endPlaceholder: { default: void 0 },
436
+ valueFormat: { default: void 0 },
437
+ defaultTime: { default: void 0 }
438
+ },
439
+ emits: ["update:modelValue"],
440
+ setup(e, { emit: t }) {
441
+ let n = e, s = t, c = m(Ne, null), l = r(() => n.datePickerValues ?? c?.value ?? {}), u = r(() => Re(n.modelValue)), d = r(() => ze(n.type)), f = r(() => d.value === "datetimerange" ? "k-form-date-picker--datetimerange" : ""), p = (e, t) => W(e instanceof Date ? e : String(e)).format(t), h = r(() => {
442
+ if (!n.modelValue) return Z(n.modelValue);
443
+ let e = d.value.includes("datetime") ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
444
+ if (Array.isArray(n.modelValue)) return n.modelValue.map((t) => p(t, e)).join(" - ");
445
+ let t = W(n.modelValue instanceof Date ? n.modelValue : String(n.modelValue));
446
+ return t.isValid() ? t.format(e) : Z(n.modelValue);
447
+ }), g = r(() => {
448
+ if (!n.limitTime) return;
449
+ let e = W().hour();
450
+ return () => Array.from({ length: 24 }, (e, t) => t).filter((t) => t < e);
451
+ });
452
+ function _(e) {
453
+ let t = new Date(e.getTime());
454
+ return t.setHours(0, 0, 0, 0), t;
455
+ }
456
+ function v(e) {
457
+ if (e == null) return null;
458
+ if (e === "today") return _(/* @__PURE__ */ new Date());
459
+ if (typeof e == "function") {
460
+ let t = e();
461
+ return t instanceof Date && !Number.isNaN(t.getTime()) ? _(t) : null;
462
+ }
463
+ return e instanceof Date && !Number.isNaN(e.getTime()) ? _(e) : null;
464
+ }
465
+ function b(e) {
466
+ if (e.date !== void 0) return v(e.date);
467
+ if (e.id) {
468
+ let t = l.value[`kitDate-${e.id}`];
469
+ if (!t) return null;
470
+ if (t instanceof Date) return _(t);
471
+ let n = W(t);
472
+ return n.isValid() ? _(n.toDate()) : null;
473
+ }
474
+ return null;
475
+ }
476
+ function x(e, t, n) {
477
+ return n === ">=" ? e >= t : n === ">" ? e > t : n === "<=" ? e <= t : n === "<" ? e < t : n === "==" && e === t;
478
+ }
479
+ function C(e) {
480
+ let t = _(e).getTime(), r = v(n.minDate);
481
+ if (r && t < r.getTime()) return !0;
482
+ let i = v(n.maxDate);
483
+ if (i && t > i.getTime()) return !0;
484
+ let a = n.dateDisabled;
485
+ return !a || (typeof a == "function" && (a = a()), !a.length) ? !1 : a.some((e) => {
486
+ let n = b(e);
487
+ return n ? x(t, n.getTime(), e.condition) : !1;
488
+ });
489
+ }
490
+ function w(e) {
491
+ s("update:modelValue", e);
492
+ }
493
+ return (t, n) => (S(), o("div", { class: y(["k-form-date-picker", f.value]) }, [
494
+ e.prepend ? (S(), o("span", {
495
+ key: 0,
496
+ class: "k-form-date-picker__text",
497
+ innerHTML: e.prepend
498
+ }, null, 8, Ze)) : a("", !0),
499
+ e.readonly ? (S(), o("span", Qe, D(h.value), 1)) : (S(), i(O(ae), {
500
+ key: 1,
501
+ "model-value": u.value,
502
+ type: d.value,
503
+ "unlink-panels": "",
504
+ placeholder: e.placeholder,
505
+ "start-placeholder": e.startPlaceholder,
506
+ "end-placeholder": e.endPlaceholder,
507
+ "value-format": e.valueFormat,
508
+ disabled: e.disabled,
509
+ "disabled-date": C,
510
+ "disabled-hours": g.value,
511
+ "default-time": e.defaultTime,
512
+ "onUpdate:modelValue": w
513
+ }, null, 8, [
514
+ "model-value",
515
+ "type",
516
+ "placeholder",
517
+ "start-placeholder",
518
+ "end-placeholder",
519
+ "value-format",
520
+ "disabled",
521
+ "disabled-hours",
522
+ "default-time"
523
+ ])),
524
+ e.append ? (S(), o("span", {
525
+ key: 3,
526
+ class: "k-form-date-picker__text",
527
+ innerHTML: e.append
528
+ }, null, 8, $e)) : a("", !0)
529
+ ], 2));
530
+ }
531
+ }), [["__scopeId", "data-v-4885818d"]]), tt = /* @__PURE__ */ f({
532
+ name: "KFormFallback",
533
+ __name: "Fallback",
534
+ props: {
535
+ modelValue: {},
536
+ componentType: {}
537
+ },
538
+ setup(e) {
539
+ let t = e, n = r(() => `[${t.componentType ?? "Unknown"}] 待迁移`), a = r(() => Ie(t.modelValue));
540
+ return (e, t) => (S(), i(O(z), {
541
+ "model-value": a.value,
542
+ disabled: "",
543
+ placeholder: n.value
544
+ }, null, 8, ["model-value", "placeholder"]));
545
+ }
546
+ }), nt = ["type"], rt = {
547
+ key: 1,
548
+ class: "k-form-input__readonly"
549
+ }, Q = /* @__PURE__ */ f({
550
+ name: "KFormInput",
551
+ inheritAttrs: !1,
552
+ __name: "Input",
553
+ props: {
554
+ modelValue: {},
555
+ options: {},
556
+ readonly: { type: Boolean },
557
+ disabled: { type: Boolean },
558
+ placeholder: { default: "请输入" },
559
+ maxlength: { default: void 0 },
560
+ maxLength: { default: void 0 },
561
+ type: { default: "text" },
562
+ leftText: { default: "" },
563
+ rightText: { default: "" },
564
+ prepend: { default: "" },
565
+ append: { default: "" },
566
+ leftClass: { default: "" },
567
+ rightClass: { default: "" },
568
+ leftClick: {
569
+ type: Function,
570
+ default: () => void 0
571
+ },
572
+ rightClick: {
573
+ type: Function,
574
+ default: () => void 0
575
+ },
576
+ componentType: { default: void 0 },
577
+ clearable: {
578
+ type: Boolean,
579
+ default: !0
580
+ }
581
+ },
582
+ emits: ["update:modelValue"],
583
+ setup(e, { emit: t }) {
584
+ let n = e, s = t, u = r(() => Ie(n.modelValue)), d = r(() => n.maxlength ?? n.maxLength), f = r(() => n.type === "textarea"), p = r(() => n.clearable && !f.value), m = r(() => {
585
+ let e = Z(u.value);
586
+ return e === "--" ? e : `${n.prepend || ""}${e}${n.append || ""}`;
587
+ });
588
+ function h(e) {
589
+ s("update:modelValue", e);
590
+ }
591
+ return (t, n) => (S(), o("div", {
592
+ class: "k-form-input",
593
+ type: f.value ? "textarea" : void 0
594
+ }, [
595
+ e.leftText ? (S(), o("div", {
596
+ key: 0,
597
+ class: y(["k-form-input__side k-form-input__side--left", e.leftClass]),
598
+ onClick: n[0] ||= (...t) => e.leftClick && e.leftClick(...t)
599
+ }, D(e.leftText), 3)) : a("", !0),
600
+ e.readonly ? (S(), o("div", rt, D(m.value), 1)) : (S(), i(O(z), _({ key: 2 }, t.$attrs, {
601
+ "model-value": u.value,
602
+ autocomplete: "off",
603
+ clearable: p.value,
604
+ disabled: e.disabled,
605
+ placeholder: e.placeholder,
606
+ maxlength: d.value,
607
+ type: e.type,
608
+ "onUpdate:modelValue": h
609
+ }), c({ _: 2 }, [e.prepend ? {
610
+ name: "prepend",
611
+ fn: N(() => [l(D(e.prepend), 1)]),
612
+ key: "0"
613
+ } : void 0, e.append ? {
614
+ name: "append",
615
+ fn: N(() => [l(D(e.append), 1)]),
616
+ key: "1"
617
+ } : void 0]), 1040, [
618
+ "model-value",
619
+ "clearable",
620
+ "disabled",
621
+ "placeholder",
622
+ "maxlength",
623
+ "type"
624
+ ])),
625
+ e.rightText ? (S(), o("div", {
626
+ key: 3,
627
+ class: y(["k-form-input__side k-form-input__side--right", e.rightClass]),
628
+ onClick: n[1] ||= (...t) => e.rightClick && e.rightClick(...t)
629
+ }, D(e.rightText), 3)) : a("", !0)
630
+ ], 8, nt));
631
+ }
632
+ }), it = ["innerHTML"], at = ["innerHTML"], ot = ["innerHTML"], st = /*#__PURE__*/ e(/* @__PURE__ */ f({
633
+ name: "KFormInputMixInput",
634
+ __name: "InputMixInput",
635
+ props: {
636
+ modelValue: {},
637
+ options: {},
638
+ readonly: { type: Boolean },
639
+ disabled: { type: Boolean },
640
+ leftText: { default: "" },
641
+ rightText: { default: "" },
642
+ centerText: { default: "" },
643
+ leftPlaceholder: { default: "" },
644
+ rightPlaceholder: { default: "" },
645
+ leftProps: { default: () => ({}) },
646
+ rightProps: { default: () => ({}) },
647
+ inputWidth: { default: 120 },
648
+ leftWidth: { default: void 0 },
649
+ rightWidth: { default: void 0 },
650
+ clearable: {
651
+ type: Boolean,
652
+ default: !0
653
+ }
654
+ },
655
+ emits: ["update:modelValue"],
656
+ setup(e, { emit: t }) {
657
+ let n = e, i = t, c = C(["", ""]);
658
+ function l(e, t) {
659
+ let n = e ?? t;
660
+ return typeof n == "number" ? `${n}px` : n;
661
+ }
662
+ function d(e) {
663
+ return !!(e?.prepend || e?.append);
664
+ }
665
+ function f(e, t) {
666
+ let r = l(e, n.inputWidth);
667
+ return d(t) ? {
668
+ "--k-mix-input-field-width": r,
669
+ flex: "0 0 auto"
670
+ } : {
671
+ width: r,
672
+ maxWidth: r,
673
+ minWidth: r,
674
+ flex: "0 0 auto"
675
+ };
676
+ }
677
+ let p = r(() => d(n.leftProps)), m = r(() => d(n.rightProps)), h = r(() => f(n.leftWidth, n.leftProps)), g = r(() => f(n.rightWidth, n.rightProps));
678
+ M(() => n.modelValue, (e) => {
679
+ Array.isArray(e) && (c.value = [String(e[0] ?? ""), String(e[1] ?? "")]);
680
+ }, { immediate: !0 });
681
+ function v(e, t) {
682
+ c.value[e] = t, i("update:modelValue", [...c.value]);
683
+ }
684
+ return (t, n) => (S(), o("div", { class: y(["k-form-input-mix-input", { "k-form-input-mix-input--readonly": e.readonly }]) }, [
685
+ e.leftText ? (S(), o("div", {
686
+ key: 0,
687
+ class: "k-form-input-mix-input__text",
688
+ innerHTML: e.leftText
689
+ }, null, 8, it)) : a("", !0),
690
+ s("div", {
691
+ class: y(["k-form-input-mix-input__control", { "k-form-input-mix-input__control--affix": p.value }]),
692
+ style: x(e.readonly ? void 0 : h.value)
693
+ }, [u(Q, _({
694
+ clearable: e.clearable,
695
+ "model-value": c.value[0],
696
+ readonly: e.readonly,
697
+ disabled: e.disabled,
698
+ placeholder: e.leftPlaceholder
699
+ }, e.leftProps, { "onUpdate:modelValue": n[0] ||= (e) => v(0, e) }), null, 16, [
700
+ "clearable",
701
+ "model-value",
702
+ "readonly",
703
+ "disabled",
704
+ "placeholder"
705
+ ])], 6),
706
+ e.centerText ? (S(), o("div", {
707
+ key: 1,
708
+ class: "k-form-input-mix-input__text",
709
+ innerHTML: e.centerText
710
+ }, null, 8, at)) : a("", !0),
711
+ s("div", {
712
+ class: y(["k-form-input-mix-input__control", { "k-form-input-mix-input__control--affix": m.value }]),
713
+ style: x(e.readonly ? void 0 : g.value)
714
+ }, [u(Q, _({
715
+ "model-value": c.value[1],
716
+ clearable: e.clearable,
717
+ readonly: e.readonly,
718
+ disabled: e.disabled,
719
+ placeholder: e.rightPlaceholder
720
+ }, e.rightProps, { "onUpdate:modelValue": n[1] ||= (e) => v(1, e) }), null, 16, [
721
+ "model-value",
722
+ "clearable",
723
+ "readonly",
724
+ "disabled",
725
+ "placeholder"
726
+ ])], 6),
727
+ e.rightText ? (S(), o("div", {
728
+ key: 2,
729
+ class: "k-form-input-mix-input__text",
730
+ innerHTML: e.rightText
731
+ }, null, 8, ot)) : a("", !0)
732
+ ], 2));
733
+ }
734
+ }), [["__scopeId", "data-v-6fdf6265"]]), ct = {
735
+ key: 0,
736
+ class: "k-form-select__readonly"
737
+ }, lt = /*#__PURE__*/ e(/* @__PURE__ */ f({
738
+ name: "KFormSelect",
739
+ inheritAttrs: !1,
740
+ __name: "Select",
741
+ props: {
742
+ modelValue: {},
743
+ options: {},
744
+ readonly: { type: Boolean },
745
+ disabled: { type: Boolean },
746
+ placeholder: { default: "请选择" },
747
+ multiple: {
748
+ type: Boolean,
749
+ default: !1
750
+ },
751
+ filterable: {
752
+ type: Boolean,
753
+ default: !0
754
+ },
755
+ clearable: {
756
+ type: Boolean,
757
+ default: !0
758
+ }
759
+ },
760
+ emits: ["update:modelValue"],
761
+ setup(e, { emit: t }) {
762
+ let a = e, s = t, c = r(() => Y(a.modelValue)), l = r(() => X(a.modelValue)), u = r(() => (a.options ?? []).map((e) => ({
763
+ label: e.label,
764
+ value: Fe(e.value),
765
+ disabled: e.disabled,
766
+ key: String(e.value)
767
+ }))), d = r(() => {
768
+ let e = u.value;
769
+ if (a.multiple) {
770
+ let t = l.value, n = e.filter((e) => t.includes(e.value)).map((e) => e.label);
771
+ return n.length ? n.join(",") : "--";
772
+ }
773
+ return e.find((e) => e.value === c.value)?.label ?? Z(c.value);
774
+ });
775
+ function f(e) {
776
+ s("update:modelValue", e);
777
+ }
778
+ return (t, r) => (S(), o("div", _({ class: ["k-form-select", { "k-form-select--readonly": e.readonly }] }, t.$attrs), [e.readonly ? (S(), o("span", ct, D(d.value), 1)) : (S(), i(O(U), {
779
+ key: 1,
780
+ "model-value": e.multiple ? l.value : c.value,
781
+ placeholder: e.placeholder,
782
+ multiple: e.multiple,
783
+ filterable: e.filterable,
784
+ clearable: e.clearable,
785
+ disabled: e.disabled,
786
+ "onUpdate:modelValue": f
787
+ }, {
788
+ default: N(() => [(S(!0), o(n, null, w(u.value, (e) => (S(), i(O(H), {
789
+ key: e.key,
790
+ label: e.label,
791
+ value: e.value,
792
+ disabled: e.disabled
793
+ }, null, 8, [
794
+ "label",
795
+ "value",
796
+ "disabled"
797
+ ]))), 128))]),
798
+ _: 1
799
+ }, 8, [
800
+ "model-value",
801
+ "placeholder",
802
+ "multiple",
803
+ "filterable",
804
+ "clearable",
805
+ "disabled"
806
+ ]))], 16));
807
+ }
808
+ }), [["__scopeId", "data-v-20fc23b7"]]), ut = {
809
+ key: 0,
810
+ class: "k-form-input-mix-select__text"
811
+ }, dt = {
812
+ key: 1,
813
+ class: "k-form-input-mix-select__text"
814
+ }, ft = {
815
+ key: 0,
816
+ class: "k-form-input-mix-select__text"
817
+ }, pt = {
818
+ key: 3,
819
+ class: "k-form-input-mix-select__text"
820
+ }, mt = /*#__PURE__*/ e(/* @__PURE__ */ f({
821
+ name: "KFormInputMixSelect",
822
+ __name: "InputMixSelect",
823
+ props: {
824
+ modelValue: {},
825
+ options: {},
826
+ readonly: { type: Boolean },
827
+ disabled: {
828
+ type: Boolean,
829
+ default: void 0
830
+ },
831
+ inputBefore: {
832
+ type: Boolean,
833
+ default: !0
834
+ },
835
+ leftText: { default: "" },
836
+ rightText: { default: "" },
837
+ centerText: { default: "" },
838
+ selectWidth: { default: 150 },
839
+ inputWidth: { default: 140 },
840
+ itemGap: { default: 8 },
841
+ inputProps: { default: () => ({}) },
842
+ selectProps: { default: () => ({}) },
843
+ inputPlaceholder: { default: "" },
844
+ selectPlaceholder: { default: "请选择" },
845
+ inputHide: {
846
+ type: Boolean,
847
+ default: !1
848
+ },
849
+ integrityCheck: {
850
+ type: Boolean,
851
+ default: !1
852
+ }
853
+ },
854
+ emits: ["update:modelValue"],
855
+ setup(e, { emit: t }) {
856
+ let i = m(Ae, null), c = e, l = t, d = C({}), f = C(""), p = C(""), h = r(() => c.inputProps.id ?? "input"), g = r(() => c.selectProps.id ?? "select"), v = r(() => {
857
+ let e = G(c.inputProps);
858
+ return delete e.id, e;
859
+ }), b = r(() => {
860
+ let e = G(c.selectProps);
861
+ return delete e.id, e;
862
+ });
863
+ function w(e, t) {
864
+ return e == null || e === "" ? t : typeof e == "number" ? `${e}px` : e;
865
+ }
866
+ function T(e) {
867
+ return !!(e?.prepend || e?.append);
868
+ }
869
+ let E = r(() => ({ gap: w(c.itemGap, "8px") }));
870
+ function O(e, t, n) {
871
+ if (c.readonly) return;
872
+ let r = w(e, t);
873
+ return T(n) ? {
874
+ "--k-mix-select-field-width": r,
875
+ flex: "0 0 auto"
876
+ } : {
877
+ width: r,
878
+ maxWidth: r,
879
+ minWidth: r,
880
+ flex: "0 0 auto"
881
+ };
882
+ }
883
+ let k = r(() => T(c.inputProps)), A = r(() => T(c.selectProps)), j = r(() => O(c.selectWidth, "150px", c.selectProps)), ee = r(() => O(c.inputWidth, "140px", c.inputProps));
884
+ function te(e) {
885
+ let { dict: t, options: n = [] } = e;
886
+ return t && i?.getGroupOptions ? i.getGroupOptions(t) : n.map((e) => ({
887
+ label: String(e.label ?? ""),
888
+ value: e.value,
889
+ disabled: e.disabled
890
+ }));
891
+ }
892
+ let N = r(() => te(c.selectProps));
893
+ function ne() {
894
+ let e = d.value[h.value], t = d.value[g.value];
895
+ if (c.integrityCheck) {
896
+ e && t || c.inputHide ? l("update:modelValue", { ...d.value }) : l("update:modelValue", "");
897
+ return;
898
+ }
899
+ l("update:modelValue", { ...d.value });
900
+ }
901
+ function P(e, t) {
902
+ d.value[t] = e, f.value = String(d.value[h.value] ?? ""), p.value = d.value[g.value], ne();
903
+ }
904
+ return M(() => c.modelValue, (e) => {
905
+ e && typeof e == "object" && !Array.isArray(e) && (d.value = G(e), f.value = String(d.value[h.value] ?? ""), p.value = d.value[g.value]);
906
+ }, {
907
+ immediate: !0,
908
+ deep: !0
909
+ }), (t, r) => (S(), o("div", { class: y(["k-form-input-mix-select", { "k-form-input-mix-select--readonly": e.readonly }]) }, [s("div", {
910
+ class: "k-form-input-mix-select__row",
911
+ style: x(E.value)
912
+ }, [
913
+ e.leftText ? (S(), o("div", ut, D(e.leftText), 1)) : a("", !0),
914
+ e.inputBefore ? (S(), o(n, { key: 1 }, [
915
+ e.inputHide ? a("", !0) : (S(), o("div", {
916
+ key: 0,
917
+ class: y(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": k.value }]),
918
+ style: x(ee.value)
919
+ }, [u(Q, _({
920
+ "model-value": f.value,
921
+ readonly: e.readonly,
922
+ disabled: e.disabled,
923
+ placeholder: e.inputPlaceholder
924
+ }, v.value, { "onUpdate:modelValue": r[0] ||= (e) => P(e, h.value) }), null, 16, [
925
+ "model-value",
926
+ "readonly",
927
+ "disabled",
928
+ "placeholder"
929
+ ])], 6)),
930
+ e.centerText ? (S(), o("div", dt, D(e.centerText), 1)) : a("", !0),
931
+ s("div", {
932
+ class: y(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": A.value }]),
933
+ style: x(j.value)
934
+ }, [u(lt, _({
935
+ "model-value": p.value,
936
+ readonly: e.readonly,
937
+ disabled: e.disabled,
938
+ options: N.value,
939
+ placeholder: e.selectPlaceholder
940
+ }, b.value, { "onUpdate:modelValue": r[1] ||= (e) => P(e, g.value) }), null, 16, [
941
+ "model-value",
942
+ "readonly",
943
+ "disabled",
944
+ "options",
945
+ "placeholder"
946
+ ])], 6)
947
+ ], 64)) : (S(), o(n, { key: 2 }, [
948
+ s("div", {
949
+ class: y(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": A.value }]),
950
+ style: x(j.value)
951
+ }, [u(lt, _({
952
+ "model-value": p.value,
953
+ readonly: e.readonly,
954
+ disabled: e.disabled,
955
+ options: N.value,
956
+ placeholder: e.selectPlaceholder
957
+ }, b.value, { "onUpdate:modelValue": r[2] ||= (e) => P(e, g.value) }), null, 16, [
958
+ "model-value",
959
+ "readonly",
960
+ "disabled",
961
+ "options",
962
+ "placeholder"
963
+ ])], 6),
964
+ e.centerText ? (S(), o("div", ft, D(e.centerText), 1)) : a("", !0),
965
+ e.inputHide ? a("", !0) : (S(), o("div", {
966
+ key: 1,
967
+ class: y(["k-form-input-mix-select__control", { "k-form-input-mix-select__control--affix": k.value }]),
968
+ style: x(ee.value)
969
+ }, [u(Q, _({
970
+ "model-value": f.value,
971
+ readonly: e.readonly,
972
+ disabled: e.disabled,
973
+ placeholder: e.inputPlaceholder
974
+ }, v.value, { "onUpdate:modelValue": r[3] ||= (e) => P(e, h.value) }), null, 16, [
975
+ "model-value",
976
+ "readonly",
977
+ "disabled",
978
+ "placeholder"
979
+ ])], 6))
980
+ ], 64)),
981
+ e.rightText && !e.inputHide ? (S(), o("div", pt, D(e.rightText), 1)) : a("", !0)
982
+ ], 4)], 2));
983
+ }
984
+ }), [["__scopeId", "data-v-1f46ef39"]]), ht = { class: "k-form-input-number" }, gt = {
985
+ key: 0,
986
+ class: "k-form-input-number__side k-form-input-number__side--left"
987
+ }, _t = {
988
+ key: 1,
989
+ class: "k-form-input-number__readonly"
990
+ }, vt = {
991
+ key: 3,
992
+ class: "k-form-input-number__side k-form-input-number__side--right"
993
+ }, yt = /*#__PURE__*/ e(/* @__PURE__ */ f({
994
+ name: "KFormInputNumber",
995
+ __name: "InputNumber",
996
+ props: {
997
+ modelValue: {},
998
+ options: {},
999
+ readonly: { type: Boolean },
1000
+ disabled: { type: Boolean },
1001
+ leftText: { default: "" },
1002
+ rightText: { default: "" },
1003
+ min: { default: void 0 },
1004
+ max: { default: void 0 },
1005
+ maxlength: { default: 1e3 }
1006
+ },
1007
+ emits: ["update:modelValue"],
1008
+ setup(e, { emit: t }) {
1009
+ let n = e, s = t, c = r(() => Le(n.modelValue));
1010
+ function l(e) {
1011
+ if (e === void 0) {
1012
+ s("update:modelValue", n.min ?? 0);
1013
+ return;
1014
+ }
1015
+ let t = String(e);
1016
+ if (t.length > n.maxlength) {
1017
+ s("update:modelValue", Number(t.slice(0, n.maxlength)));
1018
+ return;
1019
+ }
1020
+ s("update:modelValue", e);
1021
+ }
1022
+ return (t, n) => (S(), o("div", ht, [
1023
+ e.leftText ? (S(), o("div", gt, D(e.leftText), 1)) : a("", !0),
1024
+ e.readonly ? (S(), o("span", _t, D(O(Z)(c.value)), 1)) : (S(), i(O(B), {
1025
+ key: 2,
1026
+ "model-value": c.value,
1027
+ min: e.min,
1028
+ max: e.max,
1029
+ disabled: e.disabled,
1030
+ "onUpdate:modelValue": l
1031
+ }, null, 8, [
1032
+ "model-value",
1033
+ "min",
1034
+ "max",
1035
+ "disabled"
1036
+ ])),
1037
+ e.rightText ? (S(), o("div", vt, D(e.rightText), 1)) : a("", !0)
1038
+ ]));
1039
+ }
1040
+ }), [["__scopeId", "data-v-acdc4199"]]), bt = { class: "k-form-radio" }, xt = {
1041
+ key: 0,
1042
+ class: "k-form-radio__readonly"
1043
+ }, St = /*#__PURE__*/ e(/* @__PURE__ */ f({
1044
+ name: "KFormRadio",
1045
+ __name: "Radio",
1046
+ props: {
1047
+ modelValue: {},
1048
+ options: {},
1049
+ readonly: { type: Boolean },
1050
+ disabled: { type: Boolean },
1051
+ type: { default: "default" }
1052
+ },
1053
+ emits: ["update:modelValue"],
1054
+ setup(e, { emit: t }) {
1055
+ let a = e, s = t, c = r(() => Y(a.modelValue)), u = r(() => (a.options ?? []).find((e) => e.value === c.value)?.label ?? Z(c.value));
1056
+ function d(e) {
1057
+ s("update:modelValue", e);
1058
+ }
1059
+ return (t, r) => (S(), o("div", bt, [e.readonly ? (S(), o("span", xt, D(u.value), 1)) : (S(), i(O(ue), {
1060
+ key: 1,
1061
+ "model-value": c.value,
1062
+ disabled: e.disabled,
1063
+ "onUpdate:modelValue": d
1064
+ }, {
1065
+ default: N(() => [(S(!0), o(n, null, w(e.options, (t) => (S(), o(n, { key: String(t.value) }, [e.type === "button" ? (S(), i(O(le), {
1066
+ key: 0,
1067
+ value: O(Y)(t.value),
1068
+ disabled: t.disabled
1069
+ }, {
1070
+ default: N(() => [l(D(t.label), 1)]),
1071
+ _: 2
1072
+ }, 1032, ["value", "disabled"])) : (S(), i(O(ce), {
1073
+ key: 1,
1074
+ value: O(Y)(t.value),
1075
+ disabled: t.disabled
1076
+ }, {
1077
+ default: N(() => [l(D(t.label), 1)]),
1078
+ _: 2
1079
+ }, 1032, ["value", "disabled"]))], 64))), 128))]),
1080
+ _: 1
1081
+ }, 8, ["model-value", "disabled"]))]));
1082
+ }
1083
+ }), [["__scopeId", "data-v-e0ff32b0"]]), Ct = {
1084
+ key: 0,
1085
+ class: "k-form-radio-input__label"
1086
+ }, wt = {
1087
+ key: 3,
1088
+ class: "k-form-radio-input__label"
1089
+ }, Tt = {
1090
+ key: 1,
1091
+ class: "k-form-radio-input__readonly"
1092
+ }, Et = { key: 0 }, Dt = { key: 1 }, Ot = /*#__PURE__*/ e(/* @__PURE__ */ f({
1093
+ name: "KFormRadioInput",
1094
+ __name: "RadioInput",
1095
+ props: {
1096
+ modelValue: {},
1097
+ options: {},
1098
+ readonly: { type: Boolean },
1099
+ disabled: { type: Boolean },
1100
+ showInput: { default: "1" },
1101
+ type: { default: "" },
1102
+ inputPlaceholder: { default: "" },
1103
+ leftText: { default: "" },
1104
+ rightText: { default: "" },
1105
+ inputProps: { default: () => ({}) }
1106
+ },
1107
+ emits: ["update:modelValue"],
1108
+ setup(e, { emit: t }) {
1109
+ let s = e, c = t, d = C(s.options?.[0]?.value ?? ""), f = C(""), p = r(() => d.value === s.showInput);
1110
+ function m() {
1111
+ let e = Number(s.inputProps?.min ?? 1);
1112
+ return Number.isFinite(e) ? e : 1;
1113
+ }
1114
+ function h(e) {
1115
+ return e === "" || e == null;
1116
+ }
1117
+ function g(e) {
1118
+ if (s.type !== "inputNumber" || h(e)) return e;
1119
+ if (typeof e == "number") return Number.isFinite(e) ? e : "";
1120
+ let t = Number(e);
1121
+ return Number.isFinite(t) ? t : e;
1122
+ }
1123
+ let v = r(() => {
1124
+ if (h(f.value)) return null;
1125
+ let e = Number(f.value);
1126
+ return Number.isFinite(e) ? e : null;
1127
+ });
1128
+ M(() => s.modelValue, (e) => {
1129
+ if (e && typeof e == "object" && !Array.isArray(e)) {
1130
+ let t = e;
1131
+ t.radio !== void 0 && (d.value = t.radio), t.input !== void 0 && (f.value = g(t.input));
1132
+ }
1133
+ }, {
1134
+ immediate: !0,
1135
+ deep: !0
1136
+ });
1137
+ function b() {
1138
+ if (d.value === s.showInput) {
1139
+ if (s.type === "inputNumber" && h(f.value)) {
1140
+ f.value = m();
1141
+ return;
1142
+ }
1143
+ c("update:modelValue", {
1144
+ radio: d.value,
1145
+ input: f.value
1146
+ });
1147
+ return;
1148
+ }
1149
+ if (d.value !== "" && d.value != null) {
1150
+ c("update:modelValue", { radio: d.value });
1151
+ return;
1152
+ }
1153
+ c("update:modelValue", {});
1154
+ }
1155
+ M([d, f], b, { immediate: !0 });
1156
+ function x(e) {
1157
+ e === s.showInput && s.type === "inputNumber" && h(f.value) && (f.value = m()), d.value = e;
1158
+ }
1159
+ return (t, r) => (S(), o("div", { class: y(["k-form-radio-input", { "k-form-radio-input--readonly": e.readonly }]) }, [
1160
+ u(St, {
1161
+ "model-value": d.value,
1162
+ options: e.options,
1163
+ readonly: e.readonly,
1164
+ disabled: e.disabled,
1165
+ class: "k-form-radio-input__radio",
1166
+ "onUpdate:modelValue": x
1167
+ }, null, 8, [
1168
+ "model-value",
1169
+ "options",
1170
+ "readonly",
1171
+ "disabled"
1172
+ ]),
1173
+ !e.readonly && p.value ? (S(), o(n, { key: 0 }, [
1174
+ e.leftText ? (S(), o("label", Ct, D(e.leftText), 1)) : a("", !0),
1175
+ e.type === "inputNumber" ? (S(), i(O(B), _({
1176
+ key: 1,
1177
+ "model-value": v.value,
1178
+ class: "k-form-radio-input__input",
1179
+ placeholder: e.inputPlaceholder,
1180
+ disabled: e.disabled
1181
+ }, e.inputProps, { "onUpdate:modelValue": r[0] ||= (e) => f.value = e ?? "" }), null, 16, [
1182
+ "model-value",
1183
+ "placeholder",
1184
+ "disabled"
1185
+ ])) : (S(), i(O(z), _({
1186
+ key: 2,
1187
+ modelValue: f.value,
1188
+ "onUpdate:modelValue": r[1] ||= (e) => f.value = e,
1189
+ class: "k-form-radio-input__input",
1190
+ placeholder: e.inputPlaceholder,
1191
+ disabled: e.disabled
1192
+ }, e.inputProps), null, 16, [
1193
+ "modelValue",
1194
+ "placeholder",
1195
+ "disabled"
1196
+ ])),
1197
+ e.rightText ? (S(), o("label", wt, D(e.rightText), 1)) : a("", !0)
1198
+ ], 64)) : a("", !0),
1199
+ e.readonly && p.value ? (S(), o("div", Tt, [
1200
+ e.leftText ? (S(), o("label", Et, D(e.leftText), 1)) : a("", !0),
1201
+ l(" " + D(f.value) + " ", 1),
1202
+ e.rightText ? (S(), o("label", Dt, D(e.rightText), 1)) : a("", !0)
1203
+ ])) : a("", !0)
1204
+ ], 2));
1205
+ }
1206
+ }), [["__scopeId", "data-v-1543c319"]]), kt = {
1207
+ key: 0,
1208
+ class: "k-form-scroll-select__readonly"
1209
+ }, At = /*#__PURE__*/ e(/* @__PURE__ */ f({
1210
+ name: "KFormScrollSelect",
1211
+ __name: "ScrollSelect",
1212
+ props: {
1213
+ modelValue: {},
1214
+ options: {},
1215
+ readonly: { type: Boolean },
1216
+ disabled: { type: Boolean },
1217
+ multiple: {
1218
+ type: Boolean,
1219
+ default: !1
1220
+ },
1221
+ clearable: {
1222
+ type: Boolean,
1223
+ default: !1
1224
+ },
1225
+ defaultSelectedStr: { default: () => [] },
1226
+ searchKey: { default: "searchKey" },
1227
+ getListMethods: {
1228
+ type: Function,
1229
+ default: void 0
1230
+ },
1231
+ getListParams: { default: () => ({}) },
1232
+ getListFormat: {
1233
+ type: Function,
1234
+ default: (e) => Array.isArray(e) ? e : []
1235
+ },
1236
+ pageSize: { default: 10 }
1237
+ },
1238
+ emits: ["update:modelValue"],
1239
+ setup(e, { emit: t }) {
1240
+ let a = e, s = t, c = C([]), l = C(!1), u = C(!1), d = C(1), f = C(""), p = C(null), m = C(a.multiple ? [] : "");
1241
+ M(() => a.modelValue, (e) => {
1242
+ m.value = a.multiple ? X(e) : Y(e);
1243
+ }, { immediate: !0 }), M(() => a.defaultSelectedStr, (e) => {
1244
+ e?.length && (c.value = [...c.value, ...e]);
1245
+ }, {
1246
+ immediate: !0,
1247
+ deep: !0
1248
+ }), M(() => a.getListParams, () => {
1249
+ m.value = a.multiple ? [] : "", c.value = [], d.value = 1, u.value = !1, h();
1250
+ }, { deep: !0 });
1251
+ async function h() {
1252
+ if (!(!a.getListMethods || u.value || l.value)) {
1253
+ l.value = !0;
1254
+ try {
1255
+ let e = {
1256
+ ...a.getListParams,
1257
+ [a.searchKey]: f.value,
1258
+ page_no: d.value,
1259
+ page_size: a.pageSize
1260
+ }, t = await a.getListMethods(e), n = a.getListFormat(t, d.value);
1261
+ n.length < a.pageSize && (u.value = !0), c.value = c.value.concat(n);
1262
+ } finally {
1263
+ l.value = !1;
1264
+ }
1265
+ }
1266
+ }
1267
+ let g = ge((e) => {
1268
+ c.value = [], d.value = 1, u.value = !1, f.value = e, h();
1269
+ }, 500), _ = ge(() => {
1270
+ d.value += 1, h();
1271
+ }, 300);
1272
+ function y(e) {
1273
+ e !== f.value && g(e);
1274
+ }
1275
+ function b() {
1276
+ if (!p.value || u.value) return;
1277
+ let { scrollHeight: e, scrollTop: t, clientHeight: n } = p.value;
1278
+ e - t > n + 2 || _();
1279
+ }
1280
+ K(p, "scroll", b);
1281
+ function x(e) {
1282
+ if (!e) {
1283
+ p.value = null;
1284
+ return;
1285
+ }
1286
+ v(() => {
1287
+ p.value = document.querySelector(".k-form-scroll-select__dropdown .el-select-dropdown__wrap");
1288
+ });
1289
+ }
1290
+ function T(e) {
1291
+ m.value = e, s("update:modelValue", e);
1292
+ }
1293
+ let E = r(() => {
1294
+ if (a.multiple) {
1295
+ let e = X(m.value), t = c.value.filter((t) => e.includes(t.value)).map((e) => String(e.label ?? e.name ?? e.value));
1296
+ return t.length ? t.join(", ") : Z(e);
1297
+ }
1298
+ let e = Y(m.value), t = c.value.find((t) => t.value === e);
1299
+ return t ? String(t.label ?? t.name ?? t.value) : Z(e);
1300
+ });
1301
+ return h(), (t, r) => e.readonly ? (S(), o("span", kt, D(E.value), 1)) : (S(), i(O(U), {
1302
+ key: 1,
1303
+ "model-value": m.value,
1304
+ remote: "",
1305
+ filterable: "",
1306
+ "remote-method": y,
1307
+ multiple: e.multiple,
1308
+ clearable: e.clearable,
1309
+ disabled: e.disabled,
1310
+ loading: l.value,
1311
+ "popper-class": "k-form-scroll-select__dropdown",
1312
+ class: "k-form-scroll-select",
1313
+ onVisibleChange: x,
1314
+ "onUpdate:modelValue": T
1315
+ }, {
1316
+ default: N(() => [(S(!0), o(n, null, w(c.value, (e, t) => ne((S(), i(O(H), {
1317
+ key: `${e.value}-${t}`,
1318
+ label: String(e.label ?? ""),
1319
+ value: e.value
1320
+ }, null, 8, ["label", "value"])), [[te, e.isShow !== !1]])), 128))]),
1321
+ _: 1
1322
+ }, 8, [
1323
+ "model-value",
1324
+ "multiple",
1325
+ "clearable",
1326
+ "disabled",
1327
+ "loading"
1328
+ ]));
1329
+ }
1330
+ }), [["__scopeId", "data-v-dc0bba37"]]), jt = {
1331
+ key: 0,
1332
+ class: "k-form-select-multiple__readonly"
1333
+ }, $ = "all", Mt = /*#__PURE__*/ e(/* @__PURE__ */ f({
1334
+ name: "KFormSelectMultiple",
1335
+ __name: "SelectMultiple",
1336
+ props: {
1337
+ modelValue: {},
1338
+ options: {},
1339
+ readonly: { type: Boolean },
1340
+ disabled: { type: Boolean },
1341
+ placeholder: { default: "请选择" },
1342
+ showAllItem: {
1343
+ type: Boolean,
1344
+ default: !1
1345
+ }
1346
+ },
1347
+ emits: ["update:modelValue"],
1348
+ setup(e, { emit: t }) {
1349
+ let a = e, s = t, c = C([]), l = r(() => {
1350
+ let e = a.options ?? [];
1351
+ return !a.showAllItem || e.some((e) => e.value === $) ? e : [{
1352
+ label: "全选",
1353
+ value: $
1354
+ }, ...e];
1355
+ }), u = r(() => l.value.map((e) => ({
1356
+ label: e.label,
1357
+ value: Fe(e.value),
1358
+ disabled: e.disabled,
1359
+ key: String(e.value)
1360
+ }))), d = r(() => u.value.map((e) => e.value)), f = r(() => {
1361
+ let e = u.value.filter((e) => c.value.includes(e.value)).map((e) => e.label);
1362
+ return e.length ? e.join(", ") : Z(c.value);
1363
+ });
1364
+ M(() => a.modelValue, (e) => {
1365
+ c.value = X(e);
1366
+ }, { immediate: !0 });
1367
+ function p(e, t) {
1368
+ if (!a.showAllItem) {
1369
+ s("update:modelValue", e);
1370
+ return;
1371
+ }
1372
+ let n = e.includes($), r = t.includes($);
1373
+ n && e.length > t.length ? c.value = [...d.value] : !n && r && e.length !== d.value.length ? c.value = [] : n && e.length !== d.value.length ? c.value = e.filter((e) => e !== $) : !n && e.length >= d.value.length - 1 ? c.value = [$, ...e] : c.value = e, s("update:modelValue", c.value);
1374
+ }
1375
+ let m = [];
1376
+ function h(e) {
1377
+ p(e, m), m = [...c.value];
1378
+ }
1379
+ return (t, r) => e.readonly ? (S(), o("span", jt, D(f.value), 1)) : (S(), i(O(U), {
1380
+ key: 1,
1381
+ "model-value": c.value,
1382
+ multiple: "",
1383
+ "collapse-tags": "",
1384
+ "collapse-tags-tooltip": "",
1385
+ placeholder: e.placeholder,
1386
+ disabled: e.disabled,
1387
+ class: "k-form-select-multiple",
1388
+ "onUpdate:modelValue": h
1389
+ }, {
1390
+ default: N(() => [(S(!0), o(n, null, w(u.value, (e) => (S(), i(O(H), {
1391
+ key: e.key,
1392
+ label: e.label,
1393
+ value: e.value,
1394
+ disabled: e.disabled
1395
+ }, null, 8, [
1396
+ "label",
1397
+ "value",
1398
+ "disabled"
1399
+ ]))), 128))]),
1400
+ _: 1
1401
+ }, 8, [
1402
+ "model-value",
1403
+ "placeholder",
1404
+ "disabled"
1405
+ ]));
1406
+ }
1407
+ }), [["__scopeId", "data-v-e6ca06e1"]]), Nt = { class: "k-form-tag" }, Pt = /*#__PURE__*/ e(/* @__PURE__ */ f({
1408
+ name: "KFormTag",
1409
+ inheritAttrs: !1,
1410
+ __name: "Tag",
1411
+ props: {
1412
+ modelValue: {},
1413
+ options: {},
1414
+ readonly: { type: Boolean },
1415
+ disabled: {
1416
+ type: Boolean,
1417
+ default: !1
1418
+ },
1419
+ hasDefaultOption: {
1420
+ type: Boolean,
1421
+ default: !1
1422
+ },
1423
+ hasAllTag: {
1424
+ type: Boolean,
1425
+ default: !1
1426
+ },
1427
+ canUnSelect: {
1428
+ type: Boolean,
1429
+ default: !0
1430
+ },
1431
+ multiple: {
1432
+ type: Boolean,
1433
+ default: !1
1434
+ }
1435
+ },
1436
+ emits: ["update:modelValue"],
1437
+ setup(e, { emit: t }) {
1438
+ let a = e, s = t, c = C([]), u = r(() => a.hasDefaultOption || a.hasAllTag), d = r(() => {
1439
+ let e = (a.options ?? []).map((e) => ({
1440
+ label: e.label,
1441
+ value: String(e.value)
1442
+ }));
1443
+ return u.value ? [{
1444
+ label: "全部",
1445
+ value: ""
1446
+ }, ...e] : e;
1447
+ });
1448
+ function f() {
1449
+ let e = a.modelValue;
1450
+ if (Array.isArray(e)) {
1451
+ c.value = e.map(String);
1452
+ return;
1453
+ }
1454
+ let t = Y(e);
1455
+ c.value = t ? [String(t)] : [];
1456
+ }
1457
+ M(() => a.modelValue, f, { immediate: !0 });
1458
+ function p() {
1459
+ if (a.multiple) {
1460
+ s("update:modelValue", [...c.value]);
1461
+ return;
1462
+ }
1463
+ s("update:modelValue", c.value[0] ?? "");
1464
+ }
1465
+ function m(e) {
1466
+ if (a.readonly || a.disabled) return;
1467
+ let t = c.value.includes(e);
1468
+ t && a.canUnSelect ? c.value = c.value.filter((t) => t !== e) : a.multiple ? t || c.value.push(e) : c.value = [e], p();
1469
+ }
1470
+ function h(e) {
1471
+ let t = ["k-form-tag__item"];
1472
+ return a.disabled && t.push("is-disabled"), a.readonly && t.push("is-readonly"), c.value.includes(e) && t.push("is-active"), t.join(" ");
1473
+ }
1474
+ return (e, t) => (S(), o("div", Nt, [(S(!0), o(n, null, w(d.value, (e) => (S(), i(O(de), {
1475
+ key: e.value || "__all__",
1476
+ class: y(["k-form-tag__item", h(e.value)]),
1477
+ type: "info",
1478
+ effect: "plain",
1479
+ "disable-transitions": !0,
1480
+ onClick: (t) => m(e.value)
1481
+ }, {
1482
+ default: N(() => [l(D(e.label), 1)]),
1483
+ _: 2
1484
+ }, 1032, ["class", "onClick"]))), 128))]));
1485
+ }
1486
+ }), [["__scopeId", "data-v-9961a98a"]]), Ft = { class: "k-form-text" }, It = /*#__PURE__*/ e(/* @__PURE__ */ f({
1487
+ name: "KFormText",
1488
+ __name: "Text",
1489
+ props: {
1490
+ modelValue: {},
1491
+ options: {},
1492
+ readonly: { type: Boolean },
1493
+ disabled: { type: Boolean }
1494
+ },
1495
+ setup(e) {
1496
+ let t = e, n = r(() => Ie(t.modelValue));
1497
+ return (e, t) => (S(), o("div", Ft, [s("p", null, D(n.value), 1)]));
1498
+ }
1499
+ }), [["__scopeId", "data-v-9dc35114"]]), Lt = { class: "k-form-time-picker" }, Rt = ["innerHTML"], zt = {
1500
+ key: 1,
1501
+ class: "k-form-time-picker__side k-form-time-picker__side--left"
1502
+ }, Bt = {
1503
+ key: 2,
1504
+ class: "k-form-time-picker__readonly"
1505
+ }, Vt = {
1506
+ key: 4,
1507
+ class: "k-form-time-picker__side k-form-time-picker__side--right"
1508
+ }, Ht = ["innerHTML"], Ut = /*#__PURE__*/ e(/* @__PURE__ */ f({
1509
+ name: "KFormTimePicker",
1510
+ inheritAttrs: !1,
1511
+ __name: "TimePicker",
1512
+ props: {
1513
+ modelValue: {},
1514
+ options: {},
1515
+ readonly: { type: Boolean },
1516
+ disabled: { type: Boolean },
1517
+ type: { default: "time" },
1518
+ prepend: { default: "" },
1519
+ append: { default: "" },
1520
+ leftText: { default: "" },
1521
+ rightText: { default: "" },
1522
+ limitTime: {
1523
+ type: Boolean,
1524
+ default: !1
1525
+ },
1526
+ placeholder: { default: "请选择时间" },
1527
+ startPlaceholder: { default: void 0 },
1528
+ endPlaceholder: { default: void 0 },
1529
+ valueFormat: { default: "HH:mm:ss" },
1530
+ format: { default: void 0 },
1531
+ clearable: {
1532
+ type: Boolean,
1533
+ default: !0
1534
+ }
1535
+ },
1536
+ emits: ["update:modelValue"],
1537
+ setup(e, { emit: t }) {
1538
+ let n = e, s = t, c = r(() => Be(n.modelValue)), l = r(() => Ve(n.type)), u = r(() => l.value === "timerange"), d = (e, t) => {
1539
+ let n = W(e instanceof Date ? e : String(e));
1540
+ return n.isValid() ? n.format(t) : Z(e);
1541
+ }, f = r(() => {
1542
+ if (!n.modelValue) return Z(n.modelValue);
1543
+ let e = n.valueFormat || "HH:mm:ss";
1544
+ return Array.isArray(n.modelValue) ? n.modelValue.map((t) => d(t, e)).join(" - ") : d(n.modelValue, e);
1545
+ }), p = r(() => {
1546
+ if (!n.limitTime) return;
1547
+ let e = W().hour();
1548
+ return () => Array.from({ length: 24 }, (e, t) => t).filter((t) => t < e);
1549
+ }), m = r(() => {
1550
+ if (n.limitTime) return (e) => {
1551
+ let t = W();
1552
+ return e > t.hour() ? [] : e < t.hour() ? Array.from({ length: 60 }, (e, t) => t) : Array.from({ length: 60 }, (e, t) => t).filter((e) => e < t.minute());
1553
+ };
1554
+ }), h = r(() => {
1555
+ if (n.limitTime) return (e, t) => {
1556
+ let n = W();
1557
+ return e > n.hour() || e === n.hour() && t > n.minute() ? [] : e < n.hour() || e === n.hour() && t < n.minute() ? Array.from({ length: 60 }, (e, t) => t) : Array.from({ length: 60 }, (e, t) => t).filter((e) => e < n.second());
1558
+ };
1559
+ });
1560
+ function g(e) {
1561
+ s("update:modelValue", e);
1562
+ }
1563
+ return (t, n) => (S(), o("div", Lt, [
1564
+ e.prepend ? (S(), o("span", {
1565
+ key: 0,
1566
+ class: "k-form-time-picker__text",
1567
+ innerHTML: e.prepend
1568
+ }, null, 8, Rt)) : a("", !0),
1569
+ e.leftText ? (S(), o("span", zt, D(e.leftText), 1)) : a("", !0),
1570
+ e.readonly ? (S(), o("span", Bt, D(f.value), 1)) : (S(), i(O(fe), {
1571
+ key: 3,
1572
+ "model-value": c.value,
1573
+ "is-range": u.value,
1574
+ placeholder: e.placeholder,
1575
+ "start-placeholder": e.startPlaceholder,
1576
+ "end-placeholder": e.endPlaceholder,
1577
+ "value-format": e.valueFormat,
1578
+ format: e.format,
1579
+ disabled: e.disabled,
1580
+ clearable: e.clearable,
1581
+ "disabled-hours": p.value,
1582
+ "disabled-minutes": m.value,
1583
+ "disabled-seconds": h.value,
1584
+ "onUpdate:modelValue": g
1585
+ }, null, 8, [
1586
+ "model-value",
1587
+ "is-range",
1588
+ "placeholder",
1589
+ "start-placeholder",
1590
+ "end-placeholder",
1591
+ "value-format",
1592
+ "format",
1593
+ "disabled",
1594
+ "clearable",
1595
+ "disabled-hours",
1596
+ "disabled-minutes",
1597
+ "disabled-seconds"
1598
+ ])),
1599
+ e.rightText ? (S(), o("span", Vt, D(e.rightText), 1)) : a("", !0),
1600
+ e.append ? (S(), o("span", {
1601
+ key: 5,
1602
+ class: "k-form-time-picker__text",
1603
+ innerHTML: e.append
1604
+ }, null, 8, Ht)) : a("", !0)
1605
+ ]));
1606
+ }
1607
+ }), [["__scopeId", "data-v-8680ec2d"]]), Wt = { class: "k-form-tree-select" }, Gt = {
1608
+ key: 0,
1609
+ class: "k-form-input__readonly"
1610
+ }, Kt = /* @__PURE__ */ f({
1611
+ name: "KFormTreeSelect",
1612
+ __name: "TreeSelect",
1613
+ props: {
1614
+ modelValue: {},
1615
+ options: {},
1616
+ readonly: { type: Boolean },
1617
+ disabled: { type: Boolean },
1618
+ data: { default: () => [] },
1619
+ placeholder: { default: void 0 },
1620
+ clearable: {
1621
+ type: Boolean,
1622
+ default: !0
1623
+ },
1624
+ filterable: {
1625
+ type: Boolean,
1626
+ default: !0
1627
+ },
1628
+ checkStrictly: {
1629
+ type: Boolean,
1630
+ default: !0
1631
+ }
1632
+ },
1633
+ emits: ["update:modelValue"],
1634
+ setup(e, { emit: t }) {
1635
+ let n = e, a = t, s = r(() => Y(n.modelValue)), c = r(() => Ue(n.data)), l = r(() => We(c.value, s.value) ?? Z(s.value));
1636
+ return (t, n) => (S(), o("div", Wt, [e.readonly ? (S(), o("div", Gt, D(l.value), 1)) : (S(), i(O(me), {
1637
+ key: 1,
1638
+ "model-value": s.value,
1639
+ data: c.value,
1640
+ placeholder: e.placeholder,
1641
+ clearable: e.clearable,
1642
+ filterable: e.filterable,
1643
+ "check-strictly": e.checkStrictly,
1644
+ disabled: e.disabled,
1645
+ "render-after-expand": !1,
1646
+ "onUpdate:modelValue": n[0] ||= (e) => a("update:modelValue", e)
1647
+ }, null, 8, [
1648
+ "model-value",
1649
+ "data",
1650
+ "placeholder",
1651
+ "clearable",
1652
+ "filterable",
1653
+ "check-strictly",
1654
+ "disabled"
1655
+ ]))]));
1656
+ }
1657
+ }), qt = { class: "k-upload__file-item" }, Jt = ["src"], Yt = { class: "el-upload-list__item-actions" }, Xt = /*#__PURE__*/ e(/* @__PURE__ */ f({
1658
+ name: "KUploadFileItem",
1659
+ __name: "UploadFileItem",
1660
+ props: {
1661
+ file: {},
1662
+ listType: {},
1663
+ disabled: { type: Boolean }
1664
+ },
1665
+ emits: [
1666
+ "zoom",
1667
+ "download",
1668
+ "remove",
1669
+ "play"
1670
+ ],
1671
+ setup(e, { emit: t }) {
1672
+ let c = e, l = t, d = r(() => c.listType === "video" || c.listType === "audio"), f = r(() => c.file.status === "uploading"), p = r(() => Math.round(Number(c.file.percentage ?? 0)));
1673
+ return (t, r) => (S(), o("div", qt, [d.value ? (S(), o("button", {
1674
+ key: 0,
1675
+ type: "button",
1676
+ class: "k-upload__media-play",
1677
+ onClick: r[0] ||= (t) => l("play", e.file)
1678
+ }, [u(O(R), null, {
1679
+ default: N(() => [u(O(be))]),
1680
+ _: 1
1681
+ })])) : (S(), o(n, { key: 1 }, [T(t.$slots, "preview", { file: e.file }, () => [s("img", {
1682
+ class: "el-upload-list__item-thumbnail",
1683
+ src: e.file.url,
1684
+ alt: ""
1685
+ }, null, 8, Jt)], !0), s("span", Yt, [
1686
+ s("span", {
1687
+ class: "el-upload-list__item-preview",
1688
+ onClick: r[1] ||= (t) => l("zoom", e.file)
1689
+ }, [u(O(R), null, {
1690
+ default: N(() => [u(O(xe))]),
1691
+ _: 1
1692
+ })]),
1693
+ e.disabled ? a("", !0) : (S(), o("span", {
1694
+ key: 0,
1695
+ class: "el-upload-list__item-download",
1696
+ onClick: r[2] ||= (t) => l("download", e.file)
1697
+ }, [u(O(R), null, {
1698
+ default: N(() => [u(O(ve))]),
1699
+ _: 1
1700
+ })])),
1701
+ e.disabled ? a("", !0) : (S(), o("span", {
1702
+ key: 1,
1703
+ class: "el-upload-list__item-delete",
1704
+ onClick: r[3] ||= (t) => l("remove", e.file)
1705
+ }, [u(O(R), null, {
1706
+ default: N(() => [u(O(_e))]),
1707
+ _: 1
1708
+ })]))
1709
+ ])], 64)), f.value ? (S(), i(O(se), {
1710
+ key: 2,
1711
+ class: "k-upload__file-progress",
1712
+ type: e.listType === "picture-card" || e.listType === "lottie" ? "circle" : "line",
1713
+ width: e.listType === "picture-card" || e.listType === "lottie" ? 80 : void 0,
1714
+ "stroke-width": 6,
1715
+ percentage: p.value,
1716
+ "show-text": !1
1717
+ }, null, 8, [
1718
+ "type",
1719
+ "width",
1720
+ "percentage"
1721
+ ])) : a("", !0)]));
1722
+ }
1723
+ }), [["__scopeId", "data-v-01959ada"]]), Zt = { class: "k-upload__inline-actions" }, Qt = ["innerHTML"], $t = /*#__PURE__*/ e(/* @__PURE__ */ f({
1724
+ name: "KUploadInlineActions",
1725
+ __name: "UploadInlineActions",
1726
+ props: {
1727
+ templateCode: { default: "" },
1728
+ templateBtnText: { default: "模版下载" },
1729
+ tipType: { default: "text" },
1730
+ tipText: { default: "" }
1731
+ },
1732
+ emits: ["downloadTemplate"],
1733
+ setup(e, { emit: t }) {
1734
+ let n = t;
1735
+ return (t, r) => (S(), o("div", Zt, [
1736
+ e.templateCode ? (S(), o("button", {
1737
+ key: 0,
1738
+ type: "button",
1739
+ class: "k-upload__download",
1740
+ onClick: r[0] ||= P((e) => n("downloadTemplate"), ["stop"])
1741
+ }, [u(O(R), { class: "k-upload__download-icon" }, {
1742
+ default: N(() => [u(O(ve))]),
1743
+ _: 1
1744
+ }), s("span", null, D(e.templateBtnText), 1)])) : a("", !0),
1745
+ e.tipType === "text" && e.tipText ? (S(), o("span", {
1746
+ key: 1,
1747
+ class: "k-upload__inline-tip",
1748
+ innerHTML: e.tipText
1749
+ }, null, 8, Qt)) : a("", !0),
1750
+ e.tipType === "tooltip" && e.tipText ? (S(), i(O(pe), {
1751
+ key: 2,
1752
+ placement: "top",
1753
+ content: e.tipText
1754
+ }, {
1755
+ default: N(() => [...r[1] ||= [s("i", {
1756
+ class: "k-upload__tip-icon",
1757
+ "aria-label": "上传说明"
1758
+ }, "?", -1)]]),
1759
+ _: 1
1760
+ }, 8, ["content"])) : a("", !0)
1761
+ ]));
1762
+ }
1763
+ }), [["__scopeId", "data-v-aee31b8d"]]), en = { class: "k-upload__media-wrap" }, tn = ["src"], nn = ["src"], rn = /*#__PURE__*/ e(/* @__PURE__ */ f({
1764
+ name: "KUploadMediaDialog",
1765
+ __name: "UploadMediaDialog",
1766
+ props: /*@__PURE__*/ g({
1767
+ url: {},
1768
+ type: {}
1769
+ }, {
1770
+ visible: {
1771
+ type: Boolean,
1772
+ default: !1
1773
+ },
1774
+ visibleModifiers: {}
1775
+ }),
1776
+ emits: ["update:visible"],
1777
+ setup(e) {
1778
+ let t = A(e, "visible");
1779
+ return (n, r) => (S(), i(ke, {
1780
+ visible: t.value,
1781
+ "onUpdate:visible": r[0] ||= (e) => t.value = e,
1782
+ "show-confirm": !1,
1783
+ "show-cancel": !1,
1784
+ width: "640px",
1785
+ title: "预览"
1786
+ }, {
1787
+ default: N(() => [s("div", en, [e.type === "video" ? (S(), o("video", {
1788
+ key: 0,
1789
+ src: e.url,
1790
+ controls: "",
1791
+ class: "k-upload__media"
1792
+ }, "您的浏览器不支持视频播放", 8, tn)) : (S(), o("audio", {
1793
+ key: 1,
1794
+ src: e.url,
1795
+ controls: "",
1796
+ class: "k-upload__media"
1797
+ }, "您的浏览器不支持音频播放", 8, nn))])]),
1798
+ _: 1
1799
+ }, 8, ["visible"]));
1800
+ }
1801
+ }), [["__scopeId", "data-v-b9720661"]]), an = { class: "k-upload__tip-area" }, on = ["innerHTML"], sn = /* @__PURE__ */ f({
1802
+ name: "KUploadTipArea",
1803
+ __name: "UploadTipArea",
1804
+ props: {
1805
+ tipType: { default: "text" },
1806
+ tipText: { default: "" }
1807
+ },
1808
+ setup(e) {
1809
+ return (t, n) => (S(), o("div", an, [e.tipType === "text" && e.tipText ? (S(), o("div", {
1810
+ key: 0,
1811
+ class: "el-upload__tip",
1812
+ innerHTML: e.tipText
1813
+ }, null, 8, on)) : a("", !0)]));
1814
+ }
1815
+ });
1816
+ //#endregion
1817
+ //#region src/components/k-upload/composables/useImagePreview.ts
1818
+ function cn() {
1819
+ let e = C(!1), t = C([]), n = C(0);
1820
+ function r(r, i) {
1821
+ let a = i.map((e) => e.url).filter((e) => !!e), o = r.url;
1822
+ if (o && !a.includes(o) && a.unshift(o), !a.length) return !1;
1823
+ let s = o ? a.indexOf(o) : 0;
1824
+ return t.value = a, n.value = s < 0 ? 0 : s, e.value = !0, !0;
1825
+ }
1826
+ function i() {
1827
+ e.value = !1;
1828
+ }
1829
+ return {
1830
+ visible: e,
1831
+ urlList: t,
1832
+ initialIndex: n,
1833
+ open: r,
1834
+ close: i
1835
+ };
1836
+ }
1837
+ //#endregion
1838
+ //#region src/components/k-upload/composables/useMediaPreview.ts
1839
+ function ln() {
1840
+ let e = C(!1), t = C(""), n = C("video");
1841
+ function r(r, i) {
1842
+ r.url && (t.value = r.url, n.value = i, e.value = !0);
1843
+ }
1844
+ function i() {
1845
+ e.value = !1, t.value = "";
1846
+ }
1847
+ return {
1848
+ visible: e,
1849
+ url: t,
1850
+ type: n,
1851
+ open: r,
1852
+ close: i
1853
+ };
1854
+ }
1855
+ //#endregion
1856
+ //#region src/components/k-upload/composables/useUploadFileList.ts
1857
+ function un(e, t) {
1858
+ return String(e) === String(t);
1859
+ }
1860
+ function dn(e) {
1861
+ let t = C([]);
1862
+ M(() => e.getModelValue(), (e) => {
1863
+ t.value = Array.isArray(e) ? e.map((e) => ({ ...e })) : [];
1864
+ }, {
1865
+ immediate: !0,
1866
+ deep: !0
1867
+ });
1868
+ let n = r(() => t.value.map((e) => ({
1869
+ name: e.name,
1870
+ url: e.url,
1871
+ uid: e.uid,
1872
+ status: e.status ?? "success"
1873
+ })));
1874
+ function i(n) {
1875
+ t.value = n, e.onUpdate(n.map((e) => ({ ...e })));
1876
+ }
1877
+ function a(e) {
1878
+ i(t.value.filter((t) => !un(t.uid, e)));
1879
+ }
1880
+ function o(n) {
1881
+ if (e.getLimit() === 1) {
1882
+ i([n]);
1883
+ return;
1884
+ }
1885
+ i([...t.value.filter((e) => !un(e.uid, n.uid)), n]);
1886
+ }
1887
+ function s(e) {
1888
+ return t.value.find((t) => un(t.uid, e));
1889
+ }
1890
+ return {
1891
+ fileList: t,
1892
+ elFileList: n,
1893
+ publish: i,
1894
+ removeByUid: a,
1895
+ upsert: o,
1896
+ findByUid: s
1897
+ };
1898
+ }
1899
+ //#endregion
1900
+ //#region src/components/k-upload/composables/useUploadRequest.ts
1901
+ function fn() {
1902
+ let e = t();
1903
+ if (!e.uploadRequest) throw Error("[KUpload] uploadRequest 未配置,请在 setupCmsBase 中初始化上传能力");
1904
+ return e;
1905
+ }
1906
+ function pn(e, t) {
1907
+ if (String(e[t.responseCode] ?? "") !== t.responseSuccessCode) {
1908
+ let n = String(e[t.responseMsg] ?? "");
1909
+ throw Error(n || "文件上传失败");
1910
+ }
1911
+ }
1912
+ function mn(e) {
1913
+ function t(t) {
1914
+ let n = { ...t }, r = e.getTemplateCode();
1915
+ return r && (n.type_code = r), n;
1916
+ }
1917
+ return {
1918
+ httpRequest: async (e) => {
1919
+ let n = fn(), r = await n.uploadRequest({
1920
+ file: e.file,
1921
+ action: e.action,
1922
+ data: t(e.data),
1923
+ onProgress: (t) => {
1924
+ e.onProgress?.({ percent: t });
1925
+ }
1926
+ });
1927
+ return pn(r, n), r;
1928
+ },
1929
+ uploadFile: async (e, n, r) => {
1930
+ let i = fn(), a = await i.uploadRequest({
1931
+ file: e,
1932
+ action: n,
1933
+ data: t(r),
1934
+ onProgress: () => {}
1935
+ });
1936
+ return pn(a, i), a;
1937
+ }
1938
+ };
1939
+ }
1940
+ //#endregion
1941
+ //#region src/components/k-upload/composables/useUploadValidation.ts
1942
+ function hn(e) {
1943
+ let t = /* @__PURE__ */ new Set();
1944
+ function n(t) {
1945
+ let n = e.getAccept(), i = n.split(",").map((e) => e.trim()).filter(Boolean), a = t.name.slice(t.name.lastIndexOf(".")).toLowerCase();
1946
+ return i.length && !i.includes(a) ? (V.warning(`只能上传后缀是${n}的文件`), r(t), !1) : t.size / 1024 / 1024 > e.getMaxSize() ? (V.warning(`文件大小不得超过${e.getMaxSize()}M`), r(t), !1) : !0;
1947
+ }
1948
+ function r(e) {
1949
+ let n = e.uid;
1950
+ typeof n == "number" && t.add(n);
1951
+ }
1952
+ function i(e) {
1953
+ return t.has(e) ? (t.delete(e), !0) : !1;
1954
+ }
1955
+ return {
1956
+ validate: n,
1957
+ consumeRejected: i
1958
+ };
1959
+ }
1960
+ //#endregion
1961
+ //#region src/components/k-upload/resolveUploadAction.ts
1962
+ function gn(e, n) {
1963
+ if (n) return n;
1964
+ let { urls: r } = t();
1965
+ return e === "text" ? r.UPLOAD_EXCEL_URL : e === "picture" || e === "picture-card" || e === "picture2" ? r.UPLOAD_IMG_URL : r.UPLOAD_FILE_URL;
1966
+ }
1967
+ function _n(e) {
1968
+ let { urls: n } = t();
1969
+ return e === "picture" || e === "picture-card" || e === "picture2" ? n.SHOW_IMG_URL : n.DOWNLOAD_FILE_URL;
1970
+ }
1971
+ //#endregion
1972
+ //#region src/components/k-upload/KUpload.vue?vue&type=script&setup=true&lang.ts
1973
+ var vn = {
1974
+ key: 0,
1975
+ class: "k-upload__trigger-row"
1976
+ }, yn = { class: "picture-card-context" }, bn = ["innerHTML"], xn = /*#__PURE__*/ e(/* @__PURE__ */ f({
1977
+ name: "KUpload",
1978
+ inheritAttrs: !1,
1979
+ __name: "KUpload",
1980
+ props: {
1981
+ modelValue: { default: () => [] },
1982
+ listType: { default: "picture" },
1983
+ action: { default: "" },
1984
+ accept: { default: "" },
1985
+ limit: { default: void 0 },
1986
+ maxSize: { default: 2 },
1987
+ disabled: {
1988
+ type: Boolean,
1989
+ default: !1
1990
+ },
1991
+ btnText: { default: "点击上传" },
1992
+ templateCode: { default: "" },
1993
+ templateDomain: { default: "app" },
1994
+ templateDownloadUrl: { default: "" },
1995
+ templateBtnText: { default: "模版下载" },
1996
+ tipType: { default: "text" },
1997
+ fileTips: { default: "" },
1998
+ showSuccMessage: {
1999
+ type: Boolean,
2000
+ default: !0
2001
+ },
2002
+ autoUpload: {
2003
+ type: Boolean,
2004
+ default: !0
2005
+ },
2006
+ openCutter: {
2007
+ type: Boolean,
2008
+ default: !1
2009
+ },
2010
+ cutterOption: { default: () => ({}) }
2011
+ },
2012
+ emits: [
2013
+ "update:modelValue",
2014
+ "success",
2015
+ "error",
2016
+ "remove",
2017
+ "preview",
2018
+ "change",
2019
+ "exceed"
2020
+ ],
2021
+ setup(e, { expose: n, emit: f }) {
2022
+ let m = d(() => import("./ImageCutter-B4uKMA_8.js")), g = {
2023
+ picture: ".bmp,.gif,.png,.jpg,.jpeg",
2024
+ "picture-card": ".bmp,.gif,.png,.jpg,.jpeg",
2025
+ text: ".doc,.docx,.xlsx,.xls",
2026
+ video: ".mp4",
2027
+ audio: ".m4a",
2028
+ lottie: ".json"
2029
+ };
2030
+ function x(e, t) {
2031
+ let n = e instanceof Error ? e.message : String(e ?? "");
2032
+ return /timeout/i.test(n) || /ECONNABORTED/i.test(n) ? "请求超时,请稍后重试" : n || t;
2033
+ }
2034
+ let w = e, E = f, k = C(), A = ee("cutterRef"), j = C(null);
2035
+ M(A, (e) => {
2036
+ if (!e || !j.value) return;
2037
+ let t = j.value;
2038
+ j.value = null, e.openImgCutter({
2039
+ name: t.name,
2040
+ raw: t.raw
2041
+ });
2042
+ });
2043
+ function te(e) {
2044
+ if (A.value) {
2045
+ A.value.openImgCutter({
2046
+ name: e.name,
2047
+ raw: e.raw
2048
+ });
2049
+ return;
2050
+ }
2051
+ j.value = e;
2052
+ }
2053
+ function ne(e) {
2054
+ return e === "picture2" ? "picture" : e;
2055
+ }
2056
+ let P = r(() => ne(w.listType)), F = r(() => w.accept ? w.accept.toLowerCase() : g[P.value] ?? ""), { fileList: re, elFileList: ie, removeByUid: I, upsert: ae, findByUid: L } = dn({
2057
+ getModelValue: () => w.modelValue,
2058
+ onUpdate: (e) => E("update:modelValue", e),
2059
+ getLimit: () => w.limit
2060
+ }), z = hn({
2061
+ getAccept: () => F.value,
2062
+ getMaxSize: () => w.maxSize
2063
+ }), B = mn({ getTemplateCode: () => w.templateCode }), { visible: H, urlList: se, initialIndex: ce, open: le, close: ue } = cn(), { visible: U, url: de, type: fe, open: pe } = ln(), me = r(() => gn(P.value, w.action)), W = r(() => {
2064
+ switch (P.value) {
2065
+ case "picture": return "picture";
2066
+ case "picture-card":
2067
+ case "lottie": return "picture-card";
2068
+ default: return "text";
2069
+ }
2070
+ }), G = r(() => [
2071
+ "picture",
2072
+ "picture-card",
2073
+ "lottie"
2074
+ ].includes(P.value)), ge = r(() => [
2075
+ "picture-card",
2076
+ "lottie",
2077
+ "video",
2078
+ "audio"
2079
+ ].includes(P.value)), K = r(() => P.value === "picture-card" || P.value === "lottie"), _e = r(() => !K.value), ve = r(() => !w.openCutter && w.autoUpload), be = r(() => w.limit === 1 ? void 0 : w.limit), xe = r(() => !!(w.limit && w.limit !== 1 && re.value.length >= w.limit)), Se = r(() => !w.disabled), Ce = r(() => !(K.value || w.disabled || P.value === "picture" && w.tipType === "text")), J = r(() => w.disabled ? "" : w.fileTips || (F.value ? `支持上传 ${F.value} 后缀文件,且不超过${w.maxSize}M` : "")), we = r(() => J.value && (w.tipType === "tooltip" || w.tipType === "text" && P.value === "picture") ? J.value : ""), Te = r(() => {
2080
+ let e = ["k-upload", `k-upload--${P.value}`];
2081
+ return w.disabled && e.push("k-upload_detail"), xe.value && e.push("k-upload--limit"), e.join(" ");
2082
+ });
2083
+ function Ee(e, t, n) {
2084
+ let r = e ?? {}, i = String(r.resource_id ?? ""), a = String(r.file_name ?? n), o = _n(P.value);
2085
+ return {
2086
+ ...r,
2087
+ uid: t,
2088
+ name: a,
2089
+ resource_id: i,
2090
+ file_name: a,
2091
+ imp_id: r.imp_id,
2092
+ url: i ? `${o}${i}` : void 0,
2093
+ status: "success"
2094
+ };
2095
+ }
2096
+ function De(e, t, n) {
2097
+ let r = Ee(e, t, n);
2098
+ ae(r), w.showSuccMessage && V.success("文件上传成功!"), E("success", e, r);
2099
+ }
2100
+ let Oe = (e) => z.validate(e), ke = (e, t) => {
2101
+ De(e ?? {}, t.uid, t.name);
2102
+ }, Ae = (e, t) => {
2103
+ V.error(x(e, "文件上传失败!")), I(t.uid), E("error", e, t);
2104
+ }, je = (e) => {
2105
+ if (typeof e.uid == "number" && z.consumeRejected(e.uid)) return;
2106
+ let t = L(e.uid);
2107
+ I(e.uid), t && E("remove", t);
2108
+ }, Me = (e) => {
2109
+ let t = L(e.uid);
2110
+ t && (E("preview", t), !(G.value && le(t, re.value)) && ze(t));
2111
+ }, Ne = (e) => {
2112
+ if (E("change", e), !(!w.openCutter || e.status !== "ready" || !e.raw)) {
2113
+ if (z.validate(e.raw) === !1) {
2114
+ I(e.uid);
2115
+ return;
2116
+ }
2117
+ I(e.uid), v(() => {
2118
+ k.value?.handleRemove(e), te({
2119
+ name: e.name,
2120
+ raw: e.raw
2121
+ });
2122
+ });
2123
+ }
2124
+ }, Pe = (e, t) => {
2125
+ E("exceed", e, t);
2126
+ };
2127
+ function Fe(e) {
2128
+ let t = L(e.uid);
2129
+ t && le(t, re.value);
2130
+ }
2131
+ function Y(e) {
2132
+ let t = L(e.uid);
2133
+ t && ze(t);
2134
+ }
2135
+ function Ie(e) {
2136
+ let t = L(e.uid);
2137
+ I(e.uid), t && E("remove", t);
2138
+ }
2139
+ function X(e) {
2140
+ let t = L(e.uid);
2141
+ t && pe(t, P.value === "audio" ? "audio" : "video");
2142
+ }
2143
+ async function Le(e) {
2144
+ try {
2145
+ let t = gn("picture", w.action);
2146
+ De(await B.uploadFile(e, t), -Date.now(), e.name);
2147
+ } catch (e) {
2148
+ V.error(x(e, "图片上传失败!"));
2149
+ }
2150
+ }
2151
+ function Re(e, t) {
2152
+ let n = document.createElement("a");
2153
+ n.href = e, n.download = t, n.click();
2154
+ }
2155
+ function ze(e) {
2156
+ e.resource_id && Re(`${_n(P.value)}${e.resource_id}`, e.name || String(e.resource_id));
2157
+ }
2158
+ function Be() {
2159
+ let e = t(), n = e.templateCodeRelation[w.templateCode];
2160
+ if (!n) {
2161
+ V.warning("模板未配置");
2162
+ return;
2163
+ }
2164
+ Re(`${w.templateDownloadUrl || (w.templateDomain === "base" ? e.baseTemplateDownloadBaseUrl : e.templateDownloadBaseUrl) || e.urls.BASE_URL}${n}`, n);
2165
+ }
2166
+ return n({
2167
+ submit: () => k.value?.submit(),
2168
+ clearFiles: () => k.value?.clearFiles(),
2169
+ uploadRef: k
2170
+ }), (t, n) => (S(), o("div", { class: y(["k-upload-wrap", Te.value]) }, [
2171
+ u(O(he), _({
2172
+ ref_key: "uploadRef",
2173
+ ref: k
2174
+ }, t.$attrs, {
2175
+ class: "k-upload__inner",
2176
+ "file-list": O(ie),
2177
+ action: me.value,
2178
+ "list-type": W.value,
2179
+ accept: F.value,
2180
+ limit: be.value,
2181
+ disabled: e.disabled,
2182
+ "auto-upload": ve.value,
2183
+ "http-request": O(B).httpRequest,
2184
+ "before-upload": Oe,
2185
+ "on-success": ke,
2186
+ "on-error": Ae,
2187
+ "on-remove": je,
2188
+ "on-preview": Me,
2189
+ "on-change": Ne,
2190
+ "on-exceed": Pe
2191
+ }), c({
2192
+ tip: N(() => [T(t.$slots, "tip", {}, () => [K.value && (e.templateCode || e.tipType === "tooltip" && J.value) ? (S(), i($t, {
2193
+ key: 0,
2194
+ "template-code": e.templateCode,
2195
+ "template-btn-text": e.templateBtnText,
2196
+ "tip-type": e.tipType,
2197
+ "tip-text": J.value,
2198
+ onDownloadTemplate: Be
2199
+ }, null, 8, [
2200
+ "template-code",
2201
+ "template-btn-text",
2202
+ "tip-type",
2203
+ "tip-text"
2204
+ ])) : a("", !0), Ce.value ? (S(), i(sn, {
2205
+ key: 1,
2206
+ "tip-type": e.tipType,
2207
+ "tip-text": J.value
2208
+ }, null, 8, ["tip-type", "tip-text"])) : a("", !0)], !0)]),
2209
+ _: 2
2210
+ }, [Se.value ? {
2211
+ name: "default",
2212
+ fn: N(() => [_e.value ? (S(), o("div", vn, [
2213
+ T(t.$slots, "buttonBefore", {}, void 0, !0),
2214
+ T(t.$slots, "content", {}, () => [u(q, {
2215
+ type: "primary",
2216
+ disabled: xe.value
2217
+ }, {
2218
+ default: N(() => [l(D(e.btnText), 1)]),
2219
+ _: 1
2220
+ }, 8, ["disabled"])], !0),
2221
+ u($t, {
2222
+ "template-code": e.templateCode,
2223
+ "template-btn-text": e.templateBtnText,
2224
+ "tip-type": e.tipType,
2225
+ "tip-text": we.value,
2226
+ onDownloadTemplate: Be
2227
+ }, null, 8, [
2228
+ "template-code",
2229
+ "template-btn-text",
2230
+ "tip-type",
2231
+ "tip-text"
2232
+ ]),
2233
+ T(t.$slots, "buttonAfter", {}, void 0, !0)
2234
+ ])) : T(t.$slots, "content", {}, () => [s("div", yn, [u(O(R), { class: "k-upload__plus" }, {
2235
+ default: N(() => [u(O(ye))]),
2236
+ _: 1
2237
+ }), e.tipType === "text" && J.value ? (S(), o("span", {
2238
+ key: 0,
2239
+ class: "picture-card-tips",
2240
+ innerHTML: J.value
2241
+ }, null, 8, bn)) : a("", !0)])], !0, 1)]),
2242
+ key: "0"
2243
+ } : void 0, ge.value ? {
2244
+ name: "file",
2245
+ fn: N(({ file: n }) => [T(t.$slots, "file", { file: n }, () => [u(Xt, {
2246
+ file: n,
2247
+ "list-type": P.value,
2248
+ disabled: e.disabled,
2249
+ onZoom: Fe,
2250
+ onDownload: Y,
2251
+ onRemove: Ie,
2252
+ onPlay: X
2253
+ }, c({ _: 2 }, [t.$slots.preview ? {
2254
+ name: "preview",
2255
+ fn: N((e) => [T(t.$slots, "preview", b(p(e)), void 0, !0)]),
2256
+ key: "0"
2257
+ } : void 0]), 1032, [
2258
+ "file",
2259
+ "list-type",
2260
+ "disabled"
2261
+ ])], !0)]),
2262
+ key: "1"
2263
+ } : void 0]), 1040, [
2264
+ "file-list",
2265
+ "action",
2266
+ "list-type",
2267
+ "accept",
2268
+ "limit",
2269
+ "disabled",
2270
+ "auto-upload",
2271
+ "http-request"
2272
+ ]),
2273
+ e.openCutter ? (S(), i(O(m), {
2274
+ key: 0,
2275
+ ref_key: "cutterRef",
2276
+ ref: A,
2277
+ option: e.cutterOption,
2278
+ onCut: Le
2279
+ }, null, 8, ["option"])) : a("", !0),
2280
+ O(H) ? (S(), i(O(oe), {
2281
+ key: 1,
2282
+ "url-list": O(se),
2283
+ "initial-index": O(ce),
2284
+ onClose: O(ue)
2285
+ }, null, 8, [
2286
+ "url-list",
2287
+ "initial-index",
2288
+ "onClose"
2289
+ ])) : a("", !0),
2290
+ u(rn, {
2291
+ visible: O(U),
2292
+ "onUpdate:visible": n[0] ||= (e) => h(U) ? U.value = e : null,
2293
+ url: O(de),
2294
+ type: O(fe)
2295
+ }, null, 8, [
2296
+ "visible",
2297
+ "url",
2298
+ "type"
2299
+ ])
2300
+ ], 2));
2301
+ }
2302
+ }), [["__scopeId", "data-v-b075bf5b"]]), Sn = /* @__PURE__ */ f({
2303
+ name: "KFormUpload",
2304
+ inheritAttrs: !1,
2305
+ __name: "Upload",
2306
+ props: {
2307
+ modelValue: {},
2308
+ options: {},
2309
+ readonly: { type: Boolean },
2310
+ disabled: { type: Boolean },
2311
+ listType: { default: "text" },
2312
+ action: { default: "" },
2313
+ limit: { default: 1 },
2314
+ maxSize: { default: 10 },
2315
+ btnText: { default: "点击上传" },
2316
+ templateCode: { default: "" },
2317
+ templateDownloadUrl: { default: "" },
2318
+ templateBtnText: { default: "模版下载" },
2319
+ fileTips: { default: "" },
2320
+ showSuccMessage: {
2321
+ type: Boolean,
2322
+ default: !0
2323
+ }
2324
+ },
2325
+ emits: ["update:modelValue"],
2326
+ setup(e, { emit: t }) {
2327
+ let n = e, a = t, o = r(() => Array.isArray(n.modelValue) ? n.modelValue : []);
2328
+ function s(e) {
2329
+ a("update:modelValue", e);
2330
+ }
2331
+ return (e, t) => (S(), i(xn, _(e.$attrs, {
2332
+ "model-value": o.value,
2333
+ "list-type": n.listType,
2334
+ action: n.action,
2335
+ limit: n.limit,
2336
+ "max-size": n.maxSize,
2337
+ disabled: n.disabled === !0 || n.readonly === !0,
2338
+ "btn-text": n.btnText,
2339
+ "template-code": n.templateCode,
2340
+ "template-download-url": n.templateDownloadUrl,
2341
+ "template-btn-text": n.templateBtnText,
2342
+ "file-tips": n.fileTips,
2343
+ "show-succ-message": n.showSuccMessage,
2344
+ "onUpdate:modelValue": s
2345
+ }), null, 16, [
2346
+ "model-value",
2347
+ "list-type",
2348
+ "action",
2349
+ "limit",
2350
+ "max-size",
2351
+ "disabled",
2352
+ "btn-text",
2353
+ "template-code",
2354
+ "template-download-url",
2355
+ "template-btn-text",
2356
+ "file-tips",
2357
+ "show-succ-message"
2358
+ ]));
2359
+ }
2360
+ }), Cn = d(() => import("./Editor-CNxCYFmc.js")), wn = {
2361
+ Input: Q,
2362
+ Text: It,
2363
+ Select: lt,
2364
+ SelectMultiple: Mt,
2365
+ DatePicker: et,
2366
+ Radio: St,
2367
+ Checkbox: Xe,
2368
+ InputNumber: yt,
2369
+ KInputNumber: yt,
2370
+ Cascader: qe,
2371
+ TreeSelect: Kt,
2372
+ InputMixInput: st,
2373
+ InputMixSelect: mt,
2374
+ RadioInput: Ot,
2375
+ Complex: d(() => import("./Complex-CijuFsnI.js")),
2376
+ ScrollSelect: At,
2377
+ Upload: Sn,
2378
+ Tag: Pt,
2379
+ TimePicker: Ut,
2380
+ Editor: Cn
2381
+ };
2382
+ function Tn(e) {
2383
+ return wn[e] ?? tt;
2384
+ }
2385
+ function En(e) {
2386
+ Object.assign(wn, e);
2387
+ }
2388
+ //#endregion
2389
+ export { q as _, Ut as a, Q as c, Ne as d, Me as f, De as g, ke as h, _n as i, et as l, Ae as m, Tn as n, St as o, je as p, xn as r, lt as s, En as t, Xe as u };