@guoyg578/k-ui 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/KAutoComplete.vue.d.ts +2 -0
- package/dist/components/KAutoComplete.vue.js +1 -1
- package/dist/components/KAutoComplete.vue_vue_type_script_setup_true_lang.js +89 -29
- package/dist/components/KCalendar.vue.js +1 -1
- package/dist/components/KCalendar.vue_vue_type_script_setup_true_lang.js +132 -39
- package/dist/components/KCascader.vue.d.ts +2 -0
- package/dist/components/KCascader.vue.js +1 -1
- package/dist/components/KCascader.vue_vue_type_script_setup_true_lang.js +45 -43
- package/dist/components/KCheckbox.vue.d.ts +6 -2
- package/dist/components/KCheckbox.vue.js +1 -1
- package/dist/components/KCheckbox.vue_vue_type_script_setup_true_lang.js +38 -18
- package/dist/components/KCheckboxGroup.vue.d.ts +2 -0
- package/dist/components/KCheckboxGroup.vue.js +1 -1
- package/dist/components/KCheckboxGroup.vue_vue_type_script_setup_true_lang.js +23 -15
- package/dist/components/KCollapse.vue.d.ts +3 -1
- package/dist/components/KCollapse.vue.js +1 -1
- package/dist/components/KCollapse.vue_vue_type_script_setup_true_lang.js +27 -16
- package/dist/components/KCombobox.vue.js +1 -1
- package/dist/components/KCombobox.vue_vue_type_script_setup_true_lang.js +48 -47
- package/dist/components/KDataTable.vue.d.ts +48 -1
- package/dist/components/KDataTable.vue.js +1 -1
- package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +305 -74
- package/dist/components/KDatePicker.vue.d.ts +8 -0
- package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +32 -22
- package/dist/components/KDialog.vue.d.ts +4 -4
- package/dist/components/KDialog.vue.js +1 -1
- package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +83 -73
- package/dist/components/KDrawer.vue.js +1 -1
- package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +36 -35
- package/dist/components/KDropdown.vue.d.ts +4 -3
- package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +48 -30
- package/dist/components/KDynamicInput.vue.d.ts +2 -0
- package/dist/components/KDynamicInput.vue.js +1 -1
- package/dist/components/KDynamicInput.vue_vue_type_script_setup_true_lang.js +17 -6
- package/dist/components/KDynamicTags.vue.d.ts +2 -0
- package/dist/components/KDynamicTags.vue.js +1 -1
- package/dist/components/KDynamicTags.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/components/KForm.vue.d.ts +12 -0
- package/dist/components/KForm.vue.js +1 -1
- package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +26 -4
- package/dist/components/KFormField.vue.d.ts +3 -1
- package/dist/components/KFormField.vue.js +1 -1
- package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +124 -61
- package/dist/components/KInputNumber.vue.js +1 -1
- package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +35 -29
- package/dist/components/KMention.vue.d.ts +2 -0
- package/dist/components/KMention.vue.js +1 -1
- package/dist/components/KMention.vue_vue_type_script_setup_true_lang.js +34 -33
- package/dist/components/KMenu.vue.js +1 -1
- package/dist/components/KMenu.vue_vue_type_script_setup_true_lang.js +132 -51
- package/dist/components/KMenuItem.vue.js +1 -1
- package/dist/components/KMenuItem.vue_vue_type_script_setup_true_lang.js +21 -6
- package/dist/components/KMessage.d.ts +5 -0
- package/dist/components/KMessage.js +36 -23
- package/dist/components/KNotification.d.ts +8 -0
- package/dist/components/KNotification.js +45 -29
- package/dist/components/KNotificationProvider.vue.js +3 -8
- package/dist/components/KNotificationProvider.vue_vue_type_script_setup_true_lang.js +11 -0
- package/dist/components/KPagination.vue.d.ts +4 -1
- package/dist/components/KPagination.vue.js +1 -1
- package/dist/components/KPagination.vue_vue_type_script_setup_true_lang.js +36 -33
- package/dist/components/KPopover.vue_vue_type_script_setup_true_lang.js +15 -14
- package/dist/components/KRadio.vue.d.ts +1 -0
- package/dist/components/KRadio.vue.js +1 -1
- package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +22 -14
- package/dist/components/KRadioGroup.vue.d.ts +4 -2
- package/dist/components/KRadioGroup.vue.js +1 -1
- package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +16 -4
- package/dist/components/KRate.vue.d.ts +5 -0
- package/dist/components/KRate.vue.js +1 -1
- package/dist/components/KRate.vue_vue_type_script_setup_true_lang.js +72 -24
- package/dist/components/KSelect.vue.d.ts +2 -2
- package/dist/components/KSelect.vue.js +1 -1
- package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +60 -59
- package/dist/components/KSlider.vue.d.ts +2 -0
- package/dist/components/KSlider.vue.js +1 -1
- package/dist/components/KSlider.vue_vue_type_script_setup_true_lang.js +17 -16
- package/dist/components/KTextarea.vue.d.ts +2 -0
- package/dist/components/KTextarea.vue.js +1 -1
- package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/components/KTimePicker.vue.d.ts +2 -0
- package/dist/components/KTimePicker.vue.js +1 -1
- package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +63 -49
- package/dist/components/KTooltip.vue_vue_type_script_setup_true_lang.js +13 -12
- package/dist/components/KTransfer.vue.d.ts +2 -0
- package/dist/components/KTransfer.vue.js +1 -1
- package/dist/components/KTransfer.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/KTreeSelect.vue.d.ts +2 -0
- package/dist/components/KTreeSelect.vue.js +1 -1
- package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +20 -18
- package/dist/components/KUpload.vue.d.ts +14 -0
- package/dist/components/KUpload.vue.js +1 -1
- package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +159 -117
- package/dist/components/checkbox-context.d.ts +10 -0
- package/dist/components/checkbox-context.js +4 -0
- package/dist/components/form-context.d.ts +19 -2
- package/dist/components/form-context.js +31 -1
- package/dist/components/menu-context.d.ts +4 -0
- package/dist/components/radio-context.d.ts +6 -1
- package/dist/k-ui.css +1 -1
- package/dist/styles/tokens.css +40 -1
- package/package.json +1 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./
|
|
4
|
-
import
|
|
1
|
+
import e from "./KCheckbox.vue.js";
|
|
2
|
+
import t from "./KLoadingOverlay.vue.js";
|
|
3
|
+
import n from "./KEmpty.vue.js";
|
|
4
|
+
import r from "./KPagination.vue.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, normalizeStyle as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, watch as x, withModifiers as S } from "vue";
|
|
6
|
+
import { ChevronDown as ee, ChevronUp as te, ChevronsUpDown as ne } from "lucide-vue-next";
|
|
5
7
|
//#region components/KDataTable.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
8
|
+
var re = ["aria-sort"], ie = ["onClick"], ae = ["onClick"], oe = ["title"], se = {
|
|
7
9
|
key: 0,
|
|
8
10
|
class: "k-table-empty"
|
|
9
|
-
}, C = /* @__PURE__ */
|
|
11
|
+
}, C = /* @__PURE__ */ f({
|
|
10
12
|
__name: "KDataTable",
|
|
11
13
|
props: {
|
|
12
14
|
columns: {},
|
|
@@ -36,50 +38,203 @@ var x = ["onClick"], S = {
|
|
|
36
38
|
type: Boolean,
|
|
37
39
|
default: !1
|
|
38
40
|
},
|
|
41
|
+
maxHeight: {},
|
|
39
42
|
pagination: { type: [Boolean, Object] },
|
|
40
43
|
singleLine: {
|
|
41
44
|
type: Boolean,
|
|
42
45
|
default: !0
|
|
43
46
|
},
|
|
44
|
-
scrollX: {}
|
|
47
|
+
scrollX: {},
|
|
48
|
+
remote: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
},
|
|
52
|
+
checkedRowKeys: {},
|
|
53
|
+
defaultCheckedRowKeys: {},
|
|
54
|
+
sortState: {}
|
|
45
55
|
},
|
|
46
|
-
emits: [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
if (
|
|
56
|
+
emits: [
|
|
57
|
+
"rowClick",
|
|
58
|
+
"update:checkedRowKeys",
|
|
59
|
+
"update:sortState"
|
|
60
|
+
],
|
|
61
|
+
setup(C, { emit: ce }) {
|
|
62
|
+
let w = C, T = ce, E = a(() => w.columns.map((e) => e.type === "selection" ? {
|
|
63
|
+
...e,
|
|
64
|
+
key: e.key || "__selection__"
|
|
65
|
+
} : e)), le = a(() => w.size === "small" || w.size === "sm" ? "sm" : "md"), ue = a(() => w.stickyHeader || w.maxHeight !== void 0), de = a(() => w.maxHeight === void 0 ? void 0 : { maxHeight: D(w.maxHeight) }), fe = a(() => {
|
|
66
|
+
if (w.scrollX !== void 0) return { minWidth: D(w.scrollX) };
|
|
57
67
|
});
|
|
58
|
-
|
|
59
|
-
typeof e == "number"
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
function D(e) {
|
|
69
|
+
if (e !== void 0) return typeof e == "number" ? `${e}px` : e;
|
|
70
|
+
}
|
|
71
|
+
function O(e) {
|
|
72
|
+
if (e === void 0) return 0;
|
|
73
|
+
if (typeof e == "number") return e;
|
|
74
|
+
let t = /^(-?\d+(?:\.\d+)?)px$/.exec(e.trim());
|
|
75
|
+
return t ? Number(t[1]) : 0;
|
|
76
|
+
}
|
|
77
|
+
function k(e) {
|
|
78
|
+
if (e.width !== void 0) return e.width;
|
|
79
|
+
if (e.type === "selection") return 44;
|
|
80
|
+
}
|
|
81
|
+
function pe(e) {
|
|
82
|
+
let t = {}, n = k(e);
|
|
83
|
+
return n !== void 0 && (t.width = D(n)), e.minWidth !== void 0 && (t.minWidth = D(e.minWidth)), Object.keys(t).length ? t : void 0;
|
|
84
|
+
}
|
|
85
|
+
let me = a(() => {
|
|
86
|
+
let e = {}, t = 0;
|
|
87
|
+
for (let n of E.value) n.fixed === "left" && (e[n.key] = t, t += O(k(n)));
|
|
88
|
+
return e;
|
|
89
|
+
}), he = a(() => {
|
|
90
|
+
let e = {}, t = 0, n = E.value;
|
|
91
|
+
for (let r = n.length - 1; r >= 0; r--) {
|
|
92
|
+
let i = n[r];
|
|
93
|
+
i.fixed === "right" && (e[i.key] = t, t += O(k(i)));
|
|
94
|
+
}
|
|
95
|
+
return e;
|
|
96
|
+
}), ge = a(() => {
|
|
97
|
+
let e = E.value.filter((e) => e.fixed === "left");
|
|
98
|
+
return e.length ? e[e.length - 1].key : null;
|
|
99
|
+
}), _e = a(() => {
|
|
100
|
+
let e = E.value.filter((e) => e.fixed === "right");
|
|
101
|
+
return e.length ? e[0].key : null;
|
|
63
102
|
});
|
|
103
|
+
function A(e, t) {
|
|
104
|
+
if (e.fixed === "left") return {
|
|
105
|
+
position: "sticky",
|
|
106
|
+
left: `${me.value[e.key] ?? 0}px`,
|
|
107
|
+
zIndex: t ? 2 : 1
|
|
108
|
+
};
|
|
109
|
+
if (e.fixed === "right") return {
|
|
110
|
+
position: "sticky",
|
|
111
|
+
right: `${he.value[e.key] ?? 0}px`,
|
|
112
|
+
zIndex: t ? 2 : 1
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function j(e) {
|
|
116
|
+
return e.fixed === "left" ? [
|
|
117
|
+
"k-table__cell--fixed",
|
|
118
|
+
"k-table__cell--fixed-left",
|
|
119
|
+
e.key === ge.value ? "k-table__cell--fixed-left-last" : ""
|
|
120
|
+
] : e.fixed === "right" ? [
|
|
121
|
+
"k-table__cell--fixed",
|
|
122
|
+
"k-table__cell--fixed-right",
|
|
123
|
+
e.key === _e.value ? "k-table__cell--fixed-right-first" : ""
|
|
124
|
+
] : [];
|
|
125
|
+
}
|
|
126
|
+
function ve() {
|
|
127
|
+
let e = w.columns.find((e) => e.sorter && e.defaultSortOrder);
|
|
128
|
+
return e ? {
|
|
129
|
+
columnKey: e.key,
|
|
130
|
+
order: e.defaultSortOrder
|
|
131
|
+
} : null;
|
|
132
|
+
}
|
|
133
|
+
let M = g(ve()), N = a(() => w.sortState !== void 0), P = a(() => N.value ? w.sortState ?? null : M.value);
|
|
64
134
|
function F(e) {
|
|
65
|
-
return e.
|
|
135
|
+
return !!e.sorter;
|
|
66
136
|
}
|
|
67
137
|
function I(e) {
|
|
68
|
-
|
|
138
|
+
let t = P.value;
|
|
139
|
+
return t && t.columnKey === e.key ? t.order : null;
|
|
140
|
+
}
|
|
141
|
+
function ye(e) {
|
|
142
|
+
if (!F(e)) return;
|
|
143
|
+
let t = I(e);
|
|
144
|
+
return t === "ascend" ? "ascending" : t === "descend" ? "descending" : "none";
|
|
145
|
+
}
|
|
146
|
+
function be(e) {
|
|
147
|
+
if (!F(e)) return;
|
|
148
|
+
let t = I(e), n = t === null ? {
|
|
149
|
+
columnKey: e.key,
|
|
150
|
+
order: "ascend"
|
|
151
|
+
} : t === "ascend" ? {
|
|
152
|
+
columnKey: e.key,
|
|
153
|
+
order: "descend"
|
|
154
|
+
} : null;
|
|
155
|
+
N.value || (M.value = n), T("update:sortState", n);
|
|
69
156
|
}
|
|
70
|
-
function
|
|
157
|
+
function xe(e, t) {
|
|
158
|
+
return e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
|
|
159
|
+
}
|
|
160
|
+
let L = a(() => w.rows ?? w.data ?? []), R = a(() => {
|
|
161
|
+
let e = P.value;
|
|
162
|
+
if (w.remote || !e) return L.value;
|
|
163
|
+
let t = E.value.find((t) => t.key === e.columnKey && t.sorter);
|
|
164
|
+
if (!t) return L.value;
|
|
165
|
+
let n = typeof t.sorter == "function" ? t.sorter : (e, n) => xe(e[t.key], n[t.key]), r = e.order === "ascend" ? 1 : -1;
|
|
166
|
+
return L.value.slice().sort((e, t) => n(e, t) * r);
|
|
167
|
+
}), z = g(1), B = a(() => w.pagination && typeof w.pagination == "object" ? w.pagination : void 0), V = a(() => {
|
|
168
|
+
let e = Number(B.value?.pageSize ?? 0);
|
|
169
|
+
return Number.isFinite(e) && e > 0 ? e : 0;
|
|
170
|
+
}), H = a(() => R.value.length), U = a(() => {
|
|
171
|
+
if (!V.value) return R.value;
|
|
172
|
+
let e = (z.value - 1) * V.value;
|
|
173
|
+
return R.value.slice(e, e + V.value);
|
|
174
|
+
});
|
|
175
|
+
x(() => B.value?.page, (e) => {
|
|
176
|
+
typeof e == "number" && e > 0 && (z.value = e);
|
|
177
|
+
}, { immediate: !0 }), x([H, V], () => {
|
|
178
|
+
let e = V.value ? Math.max(1, Math.ceil(H.value / V.value)) : 1;
|
|
179
|
+
z.value > e && (z.value = e), z.value < 1 && (z.value = 1);
|
|
180
|
+
});
|
|
181
|
+
let W = g(new Set(w.defaultCheckedRowKeys ?? [])), G = a(() => w.checkedRowKeys !== void 0), K = a(() => G.value ? new Set(w.checkedRowKeys) : W.value), Se = a(() => E.value.find((e) => e.type === "selection")), Ce = a(() => {
|
|
182
|
+
let e = /* @__PURE__ */ new Map();
|
|
183
|
+
return L.value.forEach((t, n) => e.set(Q(t, n), t)), e;
|
|
184
|
+
});
|
|
185
|
+
function q(e) {
|
|
186
|
+
let t = Se.value;
|
|
187
|
+
return t?.disabled ? t.disabled(e) : !1;
|
|
188
|
+
}
|
|
189
|
+
function we(e, t) {
|
|
190
|
+
return K.value.has(Q(e, t));
|
|
191
|
+
}
|
|
192
|
+
let J = a(() => U.value.map((e, t) => ({
|
|
193
|
+
key: Q(e, t),
|
|
194
|
+
disabled: q(e)
|
|
195
|
+
}))), Y = a(() => J.value.filter((e) => !e.disabled)), X = a(() => Y.value.length > 0 && Y.value.every((e) => K.value.has(e.key))), Te = a(() => Y.value.some((e) => K.value.has(e.key)) && !X.value);
|
|
196
|
+
function Ee(e) {
|
|
197
|
+
G.value || (W.value = e);
|
|
198
|
+
let t = [...e], n = Ce.value;
|
|
199
|
+
T("update:checkedRowKeys", t, t.map((e) => n.get(e)).filter((e) => e !== void 0));
|
|
200
|
+
}
|
|
201
|
+
function De(e, t, n) {
|
|
202
|
+
let r = new Set(K.value), i = Q(e, t);
|
|
203
|
+
n ? r.add(i) : r.delete(i), Ee(r);
|
|
204
|
+
}
|
|
205
|
+
function Oe(e) {
|
|
206
|
+
let t = new Set(K.value);
|
|
207
|
+
for (let n of J.value) n.disabled || (e ? t.add(n.key) : t.delete(n.key));
|
|
208
|
+
Ee(t);
|
|
209
|
+
}
|
|
210
|
+
function ke(e) {
|
|
211
|
+
return e.label ?? e.title ?? e.key;
|
|
212
|
+
}
|
|
213
|
+
function Z(e, t) {
|
|
71
214
|
return e[t.key] ?? "-";
|
|
72
215
|
}
|
|
73
|
-
|
|
74
|
-
|
|
216
|
+
let Ae = 0, je = /* @__PURE__ */ new WeakMap();
|
|
217
|
+
function Q(e, t) {
|
|
218
|
+
if (typeof w.rowKey == "function") return w.rowKey(e);
|
|
219
|
+
if (typeof w.rowKey == "string") return e[w.rowKey] ?? t;
|
|
220
|
+
let n = je.get(e);
|
|
221
|
+
return n === void 0 && (n = ++Ae, je.set(e, n)), n;
|
|
75
222
|
}
|
|
76
|
-
function
|
|
77
|
-
return [{ "k-table__row--hoverable":
|
|
223
|
+
function Me(e, t) {
|
|
224
|
+
return [{ "k-table__row--hoverable": w.hoverable }, typeof w.rowClassName == "function" ? w.rowClassName(e, t) : w.rowClassName];
|
|
78
225
|
}
|
|
79
|
-
function
|
|
80
|
-
return e.render ? e.render(t, n) :
|
|
226
|
+
function Ne(e, t, n) {
|
|
227
|
+
return e.render ? e.render(t, n) : Z(t, e);
|
|
81
228
|
}
|
|
82
|
-
|
|
229
|
+
function Pe(e) {
|
|
230
|
+
let t = e.maxWidth ?? e.width;
|
|
231
|
+
if (t !== void 0) return { maxWidth: D(t) };
|
|
232
|
+
}
|
|
233
|
+
function Fe(e, t) {
|
|
234
|
+
let n = Z(e, t);
|
|
235
|
+
return n == null || n === "-" ? void 0 : String(n);
|
|
236
|
+
}
|
|
237
|
+
let $ = f({
|
|
83
238
|
props: {
|
|
84
239
|
col: {
|
|
85
240
|
type: Object,
|
|
@@ -95,61 +250,137 @@ var x = ["onClick"], S = {
|
|
|
95
250
|
}
|
|
96
251
|
},
|
|
97
252
|
setup(e) {
|
|
98
|
-
return () =>
|
|
253
|
+
return () => Ne(e.col, e.row, e.index);
|
|
99
254
|
}
|
|
100
255
|
});
|
|
101
|
-
return (
|
|
102
|
-
|
|
103
|
-
class:
|
|
256
|
+
return (a, f) => (h(), c("div", { class: p(["k-table-wrap", [`k-table-wrap--${le.value}`, { "k-table-wrap--bordered": C.bordered }]]) }, [
|
|
257
|
+
l("div", {
|
|
258
|
+
class: p(["k-table-scroll", { "k-table-scroll--sticky": ue.value }]),
|
|
259
|
+
style: m(de.value)
|
|
260
|
+
}, [l("table", {
|
|
261
|
+
class: p(["k-table", {
|
|
104
262
|
"k-table--striped": C.striped,
|
|
105
263
|
"k-table--single-line": C.singleLine
|
|
106
264
|
}]),
|
|
107
|
-
style:
|
|
108
|
-
}, [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"
|
|
135
|
-
|
|
265
|
+
style: m(fe.value)
|
|
266
|
+
}, [
|
|
267
|
+
l("colgroup", null, [(h(!0), c(i, null, _(E.value, (e) => (h(), c("col", {
|
|
268
|
+
key: e.key,
|
|
269
|
+
style: m(pe(e))
|
|
270
|
+
}, null, 4))), 128))]),
|
|
271
|
+
l("thead", null, [l("tr", null, [(h(!0), c(i, null, _(E.value, (t) => (h(), c("th", {
|
|
272
|
+
key: t.key,
|
|
273
|
+
scope: "col",
|
|
274
|
+
class: p([
|
|
275
|
+
t.align ? `k-table__th--${t.align}` : "",
|
|
276
|
+
...j(t),
|
|
277
|
+
{ "k-table__th--sortable": F(t) }
|
|
278
|
+
]),
|
|
279
|
+
style: m(A(t, !0)),
|
|
280
|
+
"aria-sort": ye(t)
|
|
281
|
+
}, [t.type === "selection" ? (h(), o(e, {
|
|
282
|
+
key: 0,
|
|
283
|
+
"model-value": X.value,
|
|
284
|
+
indeterminate: Te.value,
|
|
285
|
+
disabled: Y.value.length === 0,
|
|
286
|
+
"onUpdate:modelValue": Oe,
|
|
287
|
+
onClick: f[0] ||= S(() => {}, ["stop"])
|
|
288
|
+
}, null, 8, [
|
|
289
|
+
"model-value",
|
|
290
|
+
"indeterminate",
|
|
291
|
+
"disabled"
|
|
292
|
+
])) : F(t) ? (h(), c("button", {
|
|
293
|
+
key: 1,
|
|
294
|
+
type: "button",
|
|
295
|
+
class: "k-table__sorter",
|
|
296
|
+
onClick: (e) => be(t)
|
|
297
|
+
}, [v(a.$slots, `header-${t.key}`, { col: t }, () => [u(y(ke(t)), 1)], !0), l("span", { class: p(["k-table__sort-icon", { "is-active": I(t) }]) }, [I(t) === "ascend" ? (h(), o(b(te), {
|
|
298
|
+
key: 0,
|
|
299
|
+
size: 13
|
|
300
|
+
})) : I(t) === "descend" ? (h(), o(b(ee), {
|
|
301
|
+
key: 1,
|
|
302
|
+
size: 13
|
|
303
|
+
})) : (h(), o(b(ne), {
|
|
304
|
+
key: 2,
|
|
305
|
+
size: 13
|
|
306
|
+
}))], 2)], 8, ie)) : v(a.$slots, `header-${t.key}`, {
|
|
307
|
+
key: 2,
|
|
308
|
+
col: t
|
|
309
|
+
}, () => [u(y(ke(t)), 1)], !0)], 14, re))), 128))])]),
|
|
310
|
+
l("tbody", null, [(h(!0), c(i, null, _(U.value, (t, n) => (h(), c("tr", {
|
|
311
|
+
key: Q(t, n),
|
|
312
|
+
class: p(Me(t, n)),
|
|
313
|
+
onClick: (e) => C.hoverable && T("rowClick", t)
|
|
314
|
+
}, [(h(!0), c(i, null, _(E.value, (r) => (h(), c("td", {
|
|
315
|
+
key: r.key,
|
|
316
|
+
class: p([
|
|
317
|
+
r.cellClass,
|
|
318
|
+
r.className,
|
|
319
|
+
r.align ? `k-table__td--${r.align}` : "",
|
|
320
|
+
...j(r)
|
|
321
|
+
]),
|
|
322
|
+
style: m(A(r, !1))
|
|
323
|
+
}, [r.type === "selection" ? (h(), c("span", {
|
|
324
|
+
key: 0,
|
|
325
|
+
class: "k-table__selection",
|
|
326
|
+
onClick: f[1] ||= S(() => {}, ["stop"])
|
|
327
|
+
}, [d(e, {
|
|
328
|
+
"model-value": we(t, n),
|
|
329
|
+
disabled: q(t),
|
|
330
|
+
"onUpdate:modelValue": (e) => De(t, n, e)
|
|
331
|
+
}, null, 8, [
|
|
332
|
+
"model-value",
|
|
333
|
+
"disabled",
|
|
334
|
+
"onUpdate:modelValue"
|
|
335
|
+
])])) : r.ellipsis ? (h(), c("div", {
|
|
336
|
+
key: 1,
|
|
337
|
+
class: "k-table__ellipsis",
|
|
338
|
+
style: m(Pe(r)),
|
|
339
|
+
title: Fe(t, r)
|
|
340
|
+
}, [v(a.$slots, `cell-${r.key}`, {
|
|
341
|
+
row: t,
|
|
342
|
+
value: Z(t, r),
|
|
343
|
+
index: n
|
|
344
|
+
}, () => [d(b($), {
|
|
345
|
+
col: r,
|
|
346
|
+
row: t,
|
|
347
|
+
index: n
|
|
348
|
+
}, null, 8, [
|
|
349
|
+
"col",
|
|
350
|
+
"row",
|
|
351
|
+
"index"
|
|
352
|
+
])], !0)], 12, oe)) : v(a.$slots, `cell-${r.key}`, {
|
|
353
|
+
key: 2,
|
|
354
|
+
row: t,
|
|
355
|
+
value: Z(t, r),
|
|
356
|
+
index: n
|
|
357
|
+
}, () => [d(b($), {
|
|
358
|
+
col: r,
|
|
359
|
+
row: t,
|
|
360
|
+
index: n
|
|
361
|
+
}, null, 8, [
|
|
362
|
+
"col",
|
|
363
|
+
"row",
|
|
364
|
+
"index"
|
|
365
|
+
])], !0)], 6))), 128))], 10, ae))), 128))])
|
|
366
|
+
], 6), !C.loading && L.value.length === 0 ? (h(), c("div", se, [v(a.$slots, "empty", {}, () => [d(n, {
|
|
136
367
|
title: C.empty || "暂无数据",
|
|
137
368
|
compact: ""
|
|
138
|
-
}, null, 8, ["title"])], !0)])) :
|
|
139
|
-
|
|
369
|
+
}, null, 8, ["title"])], !0)])) : s("", !0)], 6),
|
|
370
|
+
V.value > 0 ? (h(), o(r, {
|
|
140
371
|
key: 0,
|
|
141
|
-
page:
|
|
142
|
-
"onUpdate:page":
|
|
372
|
+
page: z.value,
|
|
373
|
+
"onUpdate:page": f[2] ||= (e) => z.value = e,
|
|
143
374
|
class: "k-table-pagination",
|
|
144
|
-
"page-size":
|
|
145
|
-
total:
|
|
375
|
+
"page-size": V.value,
|
|
376
|
+
total: H.value,
|
|
146
377
|
"show-summary": ""
|
|
147
378
|
}, null, 8, [
|
|
148
379
|
"page",
|
|
149
380
|
"page-size",
|
|
150
381
|
"total"
|
|
151
|
-
])) :
|
|
152
|
-
|
|
382
|
+
])) : s("", !0),
|
|
383
|
+
d(t, {
|
|
153
384
|
show: C.loading,
|
|
154
385
|
text: "加载中..."
|
|
155
386
|
}, null, 8, ["show"])
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import '@vuepic/vue-datepicker/dist/main.css';
|
|
2
|
+
import type { Locale } from 'date-fns';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
modelValue: string | string[] | null | undefined;
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
range?: boolean;
|
|
6
7
|
enableTime?: boolean;
|
|
7
8
|
disabledDates?: (date: Date) => boolean;
|
|
9
|
+
minDate?: Date | string;
|
|
10
|
+
maxDate?: Date | string;
|
|
8
11
|
clearable?: boolean;
|
|
12
|
+
/** date-fns Locale, 默认 zhCN */
|
|
13
|
+
locale?: Locale;
|
|
14
|
+
size?: 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
9
15
|
};
|
|
10
16
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
17
|
"update:modelValue": (v: string | string[] | null) => any;
|
|
12
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
19
|
"onUpdate:modelValue"?: ((v: string | string[] | null) => any) | undefined;
|
|
14
20
|
}>, {
|
|
21
|
+
size: "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
15
22
|
clearable: boolean;
|
|
16
23
|
enableTime: boolean;
|
|
24
|
+
locale: Locale;
|
|
17
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
18
26
|
declare const _default: typeof __VLS_export;
|
|
19
27
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import {
|
|
3
|
-
import { VueDatePicker as
|
|
4
|
-
import { zhCN as
|
|
2
|
+
import { computed as e, createBlock as t, defineComponent as n, normalizeClass as r, openBlock as i, unref as a } from "vue";
|
|
3
|
+
import { VueDatePicker as o } from "@vuepic/vue-datepicker";
|
|
4
|
+
import { zhCN as s } from "date-fns/locale";
|
|
5
5
|
//#region components/KDatePicker.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var c = /* @__PURE__ */ n({
|
|
7
7
|
__name: "KDatePicker",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {},
|
|
@@ -14,44 +14,54 @@ var o = /* @__PURE__ */ t({
|
|
|
14
14
|
default: !0
|
|
15
15
|
},
|
|
16
16
|
disabledDates: {},
|
|
17
|
+
minDate: {},
|
|
18
|
+
maxDate: {},
|
|
17
19
|
clearable: {
|
|
18
20
|
type: Boolean,
|
|
19
21
|
default: !0
|
|
20
|
-
}
|
|
22
|
+
},
|
|
23
|
+
locale: { default: () => s },
|
|
24
|
+
size: { default: "md" }
|
|
21
25
|
},
|
|
22
26
|
emits: ["update:modelValue"],
|
|
23
|
-
setup(
|
|
24
|
-
let
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
+
setup(n, { emit: s }) {
|
|
28
|
+
let c = n, l = e(() => c.size === "small" || c.size === "sm" ? "sm" : c.size === "large" || c.size === "lg" ? "lg" : "md"), u = e(() => c.enableTime ? "yyyy-MM-dd HH:mm" : "yyyy-MM-dd"), d = s;
|
|
29
|
+
function f(e) {
|
|
30
|
+
d("update:modelValue", e ?? null);
|
|
27
31
|
}
|
|
28
|
-
return (
|
|
29
|
-
class: "k-dp",
|
|
30
|
-
"model-value":
|
|
31
|
-
"onUpdate:modelValue":
|
|
32
|
-
"model-type":
|
|
33
|
-
format:
|
|
34
|
-
placeholder:
|
|
35
|
-
"enable-time-picker":
|
|
36
|
-
range:
|
|
37
|
-
"disabled-dates":
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
return (e, s) => (i(), t(a(o), {
|
|
33
|
+
class: r(["k-dp", `k-dp--${l.value}`]),
|
|
34
|
+
"model-value": n.modelValue || null,
|
|
35
|
+
"onUpdate:modelValue": f,
|
|
36
|
+
"model-type": u.value,
|
|
37
|
+
format: u.value,
|
|
38
|
+
placeholder: n.placeholder,
|
|
39
|
+
"enable-time-picker": n.enableTime,
|
|
40
|
+
range: n.range,
|
|
41
|
+
"disabled-dates": n.disabledDates,
|
|
42
|
+
"min-date": n.minDate,
|
|
43
|
+
"max-date": n.maxDate,
|
|
44
|
+
clearable: n.clearable,
|
|
45
|
+
locale: n.locale,
|
|
40
46
|
"auto-apply": "",
|
|
41
47
|
teleport: "",
|
|
42
48
|
"text-input": "",
|
|
43
49
|
"month-change-on-scroll": !1
|
|
44
50
|
}, null, 8, [
|
|
51
|
+
"class",
|
|
45
52
|
"model-value",
|
|
53
|
+
"model-type",
|
|
46
54
|
"format",
|
|
47
55
|
"placeholder",
|
|
48
56
|
"enable-time-picker",
|
|
49
57
|
"range",
|
|
50
58
|
"disabled-dates",
|
|
59
|
+
"min-date",
|
|
60
|
+
"max-date",
|
|
51
61
|
"clearable",
|
|
52
62
|
"locale"
|
|
53
63
|
]));
|
|
54
64
|
}
|
|
55
65
|
});
|
|
56
66
|
//#endregion
|
|
57
|
-
export {
|
|
67
|
+
export { c as default };
|
|
@@ -14,13 +14,13 @@ type __VLS_Props = {
|
|
|
14
14
|
hideCancel?: boolean;
|
|
15
15
|
width?: string | number;
|
|
16
16
|
};
|
|
17
|
-
declare var
|
|
17
|
+
declare var __VLS_48: {}, __VLS_67: {}, __VLS_69: {};
|
|
18
18
|
type __VLS_Slots = {} & {
|
|
19
|
-
title?: (props: typeof
|
|
19
|
+
title?: (props: typeof __VLS_48) => any;
|
|
20
20
|
} & {
|
|
21
|
-
default?: (props: typeof
|
|
21
|
+
default?: (props: typeof __VLS_67) => any;
|
|
22
22
|
} & {
|
|
23
|
-
footer?: (props: typeof
|
|
23
|
+
footer?: (props: typeof __VLS_69) => any;
|
|
24
24
|
};
|
|
25
25
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
26
26
|
close: () => any;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KDialog.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KDialog.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-1151febd"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|