@ys-knife-crud/taro 0.0.5 → 0.0.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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +359 -367
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as
|
|
1
|
+
import { defineComponent as Y, ref as x, computed as I, watch as X, getCurrentInstance as ae, onMounted as G, openBlock as f, createElementBlock as m, normalizeStyle as z, createElementVNode as o, Fragment as L, renderList as H, normalizeClass as V, createCommentVNode as w, renderSlot as P, toDisplayString as $, nextTick as ie, inject as re, onBeforeUnmount as se, useSlots as ue, shallowRef as oe, provide as ce, withDirectives as fe, vShow as de, createBlock as K, withCtx as q, unref as B, withModifiers as W, createVNode as Q } from "vue";
|
|
2
2
|
import { createSelectorQuery as ye } from "@tarojs/taro";
|
|
3
|
-
import { emptyFilter as me, FilterInfo as ve, filter as A, con as M, Operator as
|
|
3
|
+
import { emptyFilter as me, FilterInfo as ve, filter as A, con as M, Operator as U } from "@ys-knife-crud/core";
|
|
4
4
|
import './index.css';const he = ["lower-threshold"], ge = { class: "yk-infinite-list__content" }, pe = ["onTap"], ke = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "yk-infinite-list__checkbox-icon"
|
|
@@ -47,81 +47,81 @@ import './index.css';const he = ["lower-threshold"], ge = { class: "yk-infinite-
|
|
|
47
47
|
showCheckbox: { type: Boolean, default: !1 }
|
|
48
48
|
},
|
|
49
49
|
emits: ["data-loaded", "error", "selection-change"],
|
|
50
|
-
setup(e, { expose:
|
|
51
|
-
const t = e,
|
|
52
|
-
function S(
|
|
53
|
-
return
|
|
50
|
+
setup(e, { expose: s, emit: r }) {
|
|
51
|
+
const t = e, d = r, c = x([]), u = x(!1), l = x(!1), n = x(!0), i = x(null), _ = x(0), b = I(() => c.value.length), y = x(/* @__PURE__ */ new Map()), C = I(() => [...y.value.values()]);
|
|
52
|
+
function S(v) {
|
|
53
|
+
return y.value.has(String(v[t.rowKey]));
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
const
|
|
57
|
-
N && !E ? R.set(
|
|
55
|
+
function T(v, p) {
|
|
56
|
+
const g = String(v[t.rowKey]), R = new Map(y.value), E = R.has(g), N = p ?? !E;
|
|
57
|
+
N && !E ? R.set(g, v) : !N && E && R.delete(g), y.value = R;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
59
|
+
function k() {
|
|
60
|
+
y.value = /* @__PURE__ */ new Map();
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
for (const
|
|
65
|
-
|
|
62
|
+
function a() {
|
|
63
|
+
const v = new Map(y.value);
|
|
64
|
+
for (const p of c.value) v.set(String(p[t.rowKey]), p);
|
|
65
|
+
y.value = v;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
for (const
|
|
70
|
-
const
|
|
71
|
-
|
|
67
|
+
function h() {
|
|
68
|
+
const v = new Map(y.value);
|
|
69
|
+
for (const p of c.value) {
|
|
70
|
+
const g = String(p[t.rowKey]);
|
|
71
|
+
v.has(g) ? v.delete(g) : v.set(g, p);
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
y.value = v;
|
|
74
74
|
}
|
|
75
|
-
X(
|
|
76
|
-
async function
|
|
77
|
-
if (
|
|
78
|
-
if (l.value ||
|
|
75
|
+
X(C, (v) => d("selection-change", [...v]));
|
|
76
|
+
async function F(v) {
|
|
77
|
+
if (v) {
|
|
78
|
+
if (l.value || u.value || !n.value) return;
|
|
79
79
|
l.value = !0;
|
|
80
80
|
} else {
|
|
81
|
-
if (
|
|
82
|
-
|
|
81
|
+
if (u.value) return;
|
|
82
|
+
u.value = !0, i.value = null;
|
|
83
83
|
}
|
|
84
84
|
try {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
} catch (
|
|
88
|
-
|
|
85
|
+
const p = v ? b.value : 0, g = await t.dataFun({ limit: t.pageSize, offset: p });
|
|
86
|
+
v ? c.value.push(...g.items) : c.value = g.items, n.value = g.hasNext ?? !1, g.totalCount != null && (_.value = g.totalCount), d("data-loaded", g, v);
|
|
87
|
+
} catch (p) {
|
|
88
|
+
i.value = p, d("error", p);
|
|
89
89
|
} finally {
|
|
90
|
-
|
|
90
|
+
v ? l.value = !1 : u.value = !1, i.value || ne();
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
function j() {
|
|
94
|
-
|
|
94
|
+
F(!0);
|
|
95
95
|
}
|
|
96
96
|
function D() {
|
|
97
|
-
|
|
97
|
+
n.value = !0, F(!1);
|
|
98
98
|
}
|
|
99
99
|
function le() {
|
|
100
|
-
|
|
100
|
+
n.value && !u.value && !l.value && j();
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const J = ae();
|
|
103
103
|
async function ne() {
|
|
104
|
-
if (!
|
|
104
|
+
if (!n.value || u.value || l.value) return;
|
|
105
105
|
await ie();
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
ye().in(
|
|
109
|
-
const R =
|
|
110
|
-
E && N && N.height <= E.height + 1 && j(),
|
|
106
|
+
const v = J == null ? void 0 : J.proxy;
|
|
107
|
+
v && await new Promise((p) => {
|
|
108
|
+
ye().in(v).select(".yk-infinite-list").boundingClientRect().select(".yk-infinite-list__content").boundingClientRect().exec((g) => {
|
|
109
|
+
const R = g ?? [], E = R[0], N = R[1];
|
|
110
|
+
E && N && N.height <= E.height + 1 && j(), p();
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
return G(() => {
|
|
115
|
-
t.immediate &&
|
|
116
|
-
}), X(() => t.dataFun, () => D()),
|
|
115
|
+
t.immediate && F(!1);
|
|
116
|
+
}), X(() => t.dataFun, () => D()), s({
|
|
117
117
|
/** 当前已加载的全部数据 */
|
|
118
|
-
items:
|
|
118
|
+
items: c,
|
|
119
119
|
/** 首屏加载态 */
|
|
120
|
-
loading:
|
|
120
|
+
loading: u,
|
|
121
121
|
/** 追加加载态 */
|
|
122
122
|
loadingMore: l,
|
|
123
123
|
/** 是否还有下一页 */
|
|
124
|
-
hasMore:
|
|
124
|
+
hasMore: n,
|
|
125
125
|
/** 重置并从第一页重新加载 */
|
|
126
126
|
reload: D,
|
|
127
127
|
/** 刷新:重置为第一页重新加载(与 YsTable 的 refresh 同名同义) */
|
|
@@ -129,95 +129,93 @@ import './index.css';const he = ["lower-threshold"], ge = { class: "yk-infinite-
|
|
|
129
129
|
/** 手动触发加载下一页(一般由触底自动触发) */
|
|
130
130
|
loadNextPage: j,
|
|
131
131
|
/** rows 别名:当前已加载的全部数据(与 YsTable 的 rows 同名) */
|
|
132
|
-
rows:
|
|
132
|
+
rows: c,
|
|
133
133
|
/** 跨页累计选中的行(showCheckbox 开启时有意义) */
|
|
134
|
-
selectedRows:
|
|
134
|
+
selectedRows: C,
|
|
135
135
|
/** 某行当前是否选中 */
|
|
136
136
|
isRowSelected: S,
|
|
137
137
|
/** 切换某行选中态(selected 缺省时取反) */
|
|
138
|
-
toggleRowSelection:
|
|
138
|
+
toggleRowSelection: T,
|
|
139
139
|
/** 清空全部选中 */
|
|
140
|
-
clearSelection:
|
|
140
|
+
clearSelection: k,
|
|
141
141
|
/** 选中当前已加载的全部行 */
|
|
142
|
-
selectAllOnPage:
|
|
142
|
+
selectAllOnPage: a,
|
|
143
143
|
/** 反选当前已加载的行 */
|
|
144
|
-
invertSelectionOnPage:
|
|
145
|
-
}), (
|
|
144
|
+
invertSelectionOnPage: h
|
|
145
|
+
}), (v, p) => (f(), m("scroll-view", {
|
|
146
146
|
class: "yk-infinite-list",
|
|
147
147
|
style: z({ height: e.height }),
|
|
148
148
|
"scroll-y": "",
|
|
149
149
|
"lower-threshold": e.threshold,
|
|
150
150
|
onScrolltolower: le
|
|
151
151
|
}, [
|
|
152
|
-
|
|
153
|
-
(
|
|
154
|
-
key: String(
|
|
155
|
-
class:
|
|
152
|
+
o("view", ge, [
|
|
153
|
+
(f(!0), m(L, null, H(c.value, (g, R) => (f(), m("view", {
|
|
154
|
+
key: String(g[e.rowKey]),
|
|
155
|
+
class: V(["yk-infinite-list__item", { "is-selected": e.showCheckbox && S(g) }])
|
|
156
156
|
}, [
|
|
157
|
-
e.showCheckbox ? (
|
|
157
|
+
e.showCheckbox ? (f(), m("view", {
|
|
158
158
|
key: 0,
|
|
159
|
-
class:
|
|
160
|
-
onTap: (E) =>
|
|
159
|
+
class: V(["yk-infinite-list__item-checkbox", { "is-checked": S(g) }]),
|
|
160
|
+
onTap: (E) => T(g)
|
|
161
161
|
}, [
|
|
162
|
-
S(
|
|
163
|
-
], 42, pe)) :
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
row:
|
|
162
|
+
S(g) ? (f(), m("text", ke, "✓")) : w("", !0)
|
|
163
|
+
], 42, pe)) : w("", !0),
|
|
164
|
+
o("view", _e, [
|
|
165
|
+
P(v.$slots, "default", {
|
|
166
|
+
row: g,
|
|
167
167
|
index: R
|
|
168
168
|
}, () => [
|
|
169
|
-
|
|
169
|
+
o("text", xe, $(JSON.stringify(g)), 1)
|
|
170
170
|
])
|
|
171
171
|
])
|
|
172
172
|
], 2))), 128)),
|
|
173
|
-
!
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
!u.value && c.value.length === 0 && !i.value ? (f(), m("view", Se, [
|
|
174
|
+
P(v.$slots, "empty", {}, () => [
|
|
175
|
+
p[0] || (p[0] = o("text", { class: "yk-infinite-list__status-text" }, "暂无数据", -1))
|
|
176
176
|
])
|
|
177
|
-
])) :
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
])) : i.value ? (f(), m("view", we, [
|
|
178
|
+
P(v.$slots, "error", { error: i.value }, () => [
|
|
179
|
+
o("text", be, "加载失败:" + $(String(i.value)), 1),
|
|
180
|
+
o("button", {
|
|
181
181
|
class: "yk-infinite-list__retry",
|
|
182
182
|
size: "mini",
|
|
183
183
|
onTap: D
|
|
184
184
|
}, "重试", 32)
|
|
185
185
|
])
|
|
186
|
-
])) :
|
|
187
|
-
l.value ? (
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
])) : w("", !0),
|
|
187
|
+
l.value ? (f(), m("view", Ce, [
|
|
188
|
+
P(v.$slots, "loading", {}, () => [
|
|
189
|
+
p[1] || (p[1] = o("view", { class: "yk-infinite-list__spinner" }, null, -1)),
|
|
190
|
+
p[2] || (p[2] = o("text", null, "加载中...", -1))
|
|
191
191
|
])
|
|
192
|
-
])) :
|
|
193
|
-
!
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
])) : w("", !0),
|
|
193
|
+
!n.value && c.value.length > 0 && !u.value ? (f(), m("view", $e, [
|
|
194
|
+
P(v.$slots, "no-more", {}, () => [
|
|
195
|
+
p[3] || (p[3] = o("text", null, "— 没有更多了 —", -1))
|
|
196
196
|
])
|
|
197
|
-
])) :
|
|
197
|
+
])) : w("", !0)
|
|
198
198
|
])
|
|
199
199
|
], 44, he));
|
|
200
200
|
}
|
|
201
201
|
}), te = Symbol("YsFilterPanel");
|
|
202
202
|
function Be(e) {
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
205
|
-
let
|
|
203
|
+
const s = re(te, null);
|
|
204
|
+
if (!s) return;
|
|
205
|
+
let r = null;
|
|
206
206
|
G(() => {
|
|
207
|
-
|
|
207
|
+
r = s(e);
|
|
208
208
|
}), se(() => {
|
|
209
|
-
|
|
209
|
+
r == null || r(), r = null;
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
-
const Ie = { class: "yk-filter-panel__bar" },
|
|
212
|
+
const Ie = { class: "yk-filter-panel__bar" }, Te = { class: "yk-filter-panel__trigger-text" }, Pe = { class: "yk-filter-panel__arrow" }, Ve = { class: "yk-filter-panel__field" }, Re = ["value", "placeholder"], Ye = { class: "yk-filter-panel__actions" }, Ee = {
|
|
213
213
|
key: 0,
|
|
214
214
|
class: "yk-filter-panel__conditions"
|
|
215
215
|
}, qe = /* @__PURE__ */ Y({
|
|
216
216
|
name: "YsFilterPanel",
|
|
217
217
|
__name: "filter-panel",
|
|
218
218
|
props: {
|
|
219
|
-
/** 文本搜索框的值(v-model) */
|
|
220
|
-
modelValue: { type: String, default: "" },
|
|
221
219
|
/** 文本搜索框占位文案 */
|
|
222
220
|
placeholder: { type: String, default: "请输入" },
|
|
223
221
|
/** 展开/折叠触发器文案,默认「筛选」 */
|
|
@@ -255,97 +253,98 @@ const Ie = { class: "yk-filter-panel__bar" }, Ve = { class: "yk-filter-panel__tr
|
|
|
255
253
|
/** 外部自定义样式:追加到根节点上的内联样式字符串 */
|
|
256
254
|
customStyle: { type: String, default: "" }
|
|
257
255
|
},
|
|
258
|
-
emits: ["
|
|
259
|
-
setup(e, { expose:
|
|
260
|
-
const t = e,
|
|
261
|
-
function
|
|
262
|
-
return
|
|
263
|
-
|
|
256
|
+
emits: ["search", "reset", "expand-change"],
|
|
257
|
+
setup(e, { expose: s, emit: r }) {
|
|
258
|
+
const t = e, d = r, c = ue(), u = I(() => !!c.default), l = x(t.defaultExpanded), n = x(""), i = oe([]);
|
|
259
|
+
function _(a) {
|
|
260
|
+
return i.value = [...i.value, a], () => {
|
|
261
|
+
i.value = i.value.filter((h) => h !== a);
|
|
264
262
|
};
|
|
265
263
|
}
|
|
266
|
-
ce(te,
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
h
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
_ && o.push(_);
|
|
264
|
+
ce(te, _);
|
|
265
|
+
const b = I(() => {
|
|
266
|
+
const a = n.value.trim();
|
|
267
|
+
return !a || !t.textFilterBuilder ? null : t.textFilterBuilder(a) ?? null;
|
|
268
|
+
}), y = I(() => {
|
|
269
|
+
const a = [];
|
|
270
|
+
b.value && a.push(b.value);
|
|
271
|
+
for (const h of i.value) {
|
|
272
|
+
const F = h.filter;
|
|
273
|
+
F && a.push(F);
|
|
277
274
|
}
|
|
278
|
-
return
|
|
275
|
+
return a.length === 0 ? me() : a.length === 1 ? a[0] : ve.createAnd(...a);
|
|
279
276
|
});
|
|
280
|
-
function
|
|
281
|
-
l.value = !l.value,
|
|
277
|
+
function C() {
|
|
278
|
+
l.value = !l.value, d("expand-change", l.value);
|
|
282
279
|
}
|
|
283
|
-
function
|
|
284
|
-
const
|
|
285
|
-
|
|
280
|
+
function S(a) {
|
|
281
|
+
const h = a.detail;
|
|
282
|
+
n.value = (h == null ? void 0 : h.value) ?? "";
|
|
286
283
|
}
|
|
287
|
-
function
|
|
288
|
-
|
|
284
|
+
function T() {
|
|
285
|
+
d("search", y.value);
|
|
289
286
|
}
|
|
290
|
-
function
|
|
291
|
-
|
|
292
|
-
for (const
|
|
293
|
-
|
|
287
|
+
function k() {
|
|
288
|
+
n.value = "";
|
|
289
|
+
for (const a of i.value) a.reset();
|
|
290
|
+
d("reset");
|
|
294
291
|
}
|
|
295
|
-
return
|
|
292
|
+
return s({
|
|
293
|
+
/** 文本搜索框当前值(只读读取用,外部不能写入) */
|
|
294
|
+
keyword: n,
|
|
296
295
|
/** 条件区是否展开 */
|
|
297
296
|
expanded: l,
|
|
298
297
|
/** 当前聚合后的查询条件 */
|
|
299
|
-
filter:
|
|
298
|
+
filter: y,
|
|
300
299
|
/** 切换条件区展开/折叠 */
|
|
301
|
-
toggle:
|
|
300
|
+
toggle: C,
|
|
302
301
|
/** 重置(清空文本 + 重置已注册子项 + 派发 reset) */
|
|
303
|
-
reset:
|
|
304
|
-
}), (
|
|
305
|
-
class:
|
|
302
|
+
reset: k
|
|
303
|
+
}), (a, h) => (f(), m("view", {
|
|
304
|
+
class: V(["yk-filter-panel", e.customClass]),
|
|
306
305
|
style: z(e.customStyle)
|
|
307
306
|
}, [
|
|
308
|
-
|
|
309
|
-
|
|
307
|
+
o("view", Ie, [
|
|
308
|
+
u.value ? (f(), m("view", {
|
|
310
309
|
key: 0,
|
|
311
310
|
class: "yk-filter-panel__trigger",
|
|
312
|
-
onTap:
|
|
311
|
+
onTap: C
|
|
313
312
|
}, [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
], 32)) :
|
|
317
|
-
|
|
318
|
-
|
|
313
|
+
o("text", Te, $(e.filterText), 1),
|
|
314
|
+
o("text", Pe, $(l.value ? "▲" : "▼"), 1)
|
|
315
|
+
], 32)) : w("", !0),
|
|
316
|
+
o("view", Ve, [
|
|
317
|
+
o("input", {
|
|
319
318
|
class: "yk-filter-panel__input",
|
|
320
|
-
value:
|
|
319
|
+
value: n.value,
|
|
321
320
|
placeholder: e.placeholder,
|
|
322
321
|
"placeholder-class": "yk-filter-panel__placeholder",
|
|
323
|
-
onInput:
|
|
324
|
-
onConfirm:
|
|
322
|
+
onInput: S,
|
|
323
|
+
onConfirm: T
|
|
325
324
|
}, null, 40, Re)
|
|
326
325
|
]),
|
|
327
|
-
|
|
328
|
-
e.showSearch ? (
|
|
326
|
+
o("view", Ye, [
|
|
327
|
+
e.showSearch ? (f(), m("view", {
|
|
329
328
|
key: 0,
|
|
330
329
|
class: "yk-filter-panel__btn yk-filter-panel__btn--primary",
|
|
331
|
-
onTap:
|
|
330
|
+
onTap: T
|
|
332
331
|
}, [
|
|
333
|
-
|
|
334
|
-
], 32)) :
|
|
335
|
-
e.showReset ? (
|
|
332
|
+
o("text", null, $(e.searchButtonText), 1)
|
|
333
|
+
], 32)) : w("", !0),
|
|
334
|
+
e.showReset ? (f(), m("view", {
|
|
336
335
|
key: 1,
|
|
337
336
|
class: "yk-filter-panel__btn yk-filter-panel__btn--default",
|
|
338
|
-
onTap:
|
|
337
|
+
onTap: k
|
|
339
338
|
}, [
|
|
340
|
-
|
|
341
|
-
], 32)) :
|
|
339
|
+
o("text", null, $(e.resetButtonText), 1)
|
|
340
|
+
], 32)) : w("", !0)
|
|
342
341
|
])
|
|
343
342
|
]),
|
|
344
|
-
|
|
345
|
-
|
|
343
|
+
u.value ? fe((f(), m("view", Ee, [
|
|
344
|
+
P(a.$slots, "default")
|
|
346
345
|
], 512)), [
|
|
347
346
|
[de, l.value]
|
|
348
|
-
]) :
|
|
347
|
+
]) : w("", !0)
|
|
349
348
|
], 6));
|
|
350
349
|
}
|
|
351
350
|
}), Ae = { class: "yk-filter-item" }, Me = {
|
|
@@ -361,95 +360,95 @@ const Ie = { class: "yk-filter-panel__bar" }, Ve = { class: "yk-filter-panel__tr
|
|
|
361
360
|
api: { type: Object, required: !0 }
|
|
362
361
|
},
|
|
363
362
|
setup(e) {
|
|
364
|
-
return Be(e.api), (
|
|
365
|
-
e.label ? (
|
|
366
|
-
|
|
367
|
-
|
|
363
|
+
return Be(e.api), (r, t) => (f(), m("view", Ae, [
|
|
364
|
+
e.label ? (f(), m("text", Me, $(e.label), 1)) : w("", !0),
|
|
365
|
+
o("view", Ne, [
|
|
366
|
+
P(r.$slots, "default")
|
|
368
367
|
])
|
|
369
368
|
]));
|
|
370
369
|
}
|
|
371
370
|
});
|
|
372
371
|
function De(e) {
|
|
373
|
-
const
|
|
372
|
+
const s = x(
|
|
374
373
|
typeof e.defaultValue == "string" ? e.defaultValue : ""
|
|
375
374
|
);
|
|
376
|
-
function
|
|
377
|
-
return
|
|
375
|
+
function r(c) {
|
|
376
|
+
return c == null || c.trim() === "";
|
|
378
377
|
}
|
|
379
|
-
const t =
|
|
380
|
-
function
|
|
381
|
-
|
|
378
|
+
const t = I(() => r(s.value) ? null : A(e.propertyPath, e.op, M(s.value)));
|
|
379
|
+
function d() {
|
|
380
|
+
s.value = typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
382
381
|
}
|
|
383
|
-
return { value:
|
|
382
|
+
return { value: s, filter: t, reset: d };
|
|
384
383
|
}
|
|
385
384
|
function Le(e) {
|
|
386
|
-
const
|
|
385
|
+
const s = x(
|
|
387
386
|
typeof e.defaultValue == "string" ? e.defaultValue : ""
|
|
388
387
|
);
|
|
389
|
-
function
|
|
390
|
-
return
|
|
388
|
+
function r(c) {
|
|
389
|
+
return c == null || c.trim() === "";
|
|
391
390
|
}
|
|
392
|
-
const t =
|
|
393
|
-
function
|
|
394
|
-
|
|
391
|
+
const t = I(() => r(s.value) ? null : A(e.propertyPath, e.op, M(s.value)));
|
|
392
|
+
function d() {
|
|
393
|
+
s.value = typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
395
394
|
}
|
|
396
|
-
return { value:
|
|
395
|
+
return { value: s, filter: t, reset: d };
|
|
397
396
|
}
|
|
398
397
|
function ze(e) {
|
|
399
|
-
function
|
|
398
|
+
function s(l) {
|
|
400
399
|
return l && l.length === 2 && typeof l[0] == "string" && typeof l[1] == "string" ? [l[0], l[1]] : null;
|
|
401
400
|
}
|
|
402
|
-
const
|
|
403
|
-
function
|
|
401
|
+
const r = s(e.defaultValue), t = x(r);
|
|
402
|
+
function d(l) {
|
|
404
403
|
return l == null || l.length !== 2 || !l[0] || !l[1];
|
|
405
404
|
}
|
|
406
|
-
const
|
|
407
|
-
if (
|
|
408
|
-
const [l,
|
|
409
|
-
return A(e.propertyPath,
|
|
405
|
+
const c = I(() => {
|
|
406
|
+
if (d(t.value)) return null;
|
|
407
|
+
const [l, n] = t.value;
|
|
408
|
+
return A(e.propertyPath, U.Between, M([l, n]));
|
|
410
409
|
});
|
|
411
|
-
function
|
|
412
|
-
t.value =
|
|
410
|
+
function u() {
|
|
411
|
+
t.value = r;
|
|
413
412
|
}
|
|
414
|
-
return { value: t, filter:
|
|
413
|
+
return { value: t, filter: c, reset: u };
|
|
415
414
|
}
|
|
416
415
|
function Z(e) {
|
|
417
416
|
return typeof e == "string" || typeof e == "number" ? e : null;
|
|
418
417
|
}
|
|
419
418
|
function ee(e) {
|
|
420
419
|
return Array.isArray(e) ? e.filter(
|
|
421
|
-
(
|
|
420
|
+
(s) => typeof s == "string" || typeof s == "number"
|
|
422
421
|
) : [];
|
|
423
422
|
}
|
|
424
423
|
function Ke(e) {
|
|
425
|
-
const
|
|
426
|
-
|
|
424
|
+
const s = e.multiple === !0, r = x(
|
|
425
|
+
s ? ee(e.defaultValue) : Z(e.defaultValue)
|
|
427
426
|
);
|
|
428
427
|
function t() {
|
|
429
|
-
const
|
|
430
|
-
return
|
|
428
|
+
const u = r.value;
|
|
429
|
+
return s ? !Array.isArray(u) || u.length === 0 : u == null || typeof u == "string" && u.trim() === "";
|
|
431
430
|
}
|
|
432
|
-
const
|
|
431
|
+
const d = I(() => {
|
|
433
432
|
if (t()) return null;
|
|
434
|
-
if (
|
|
435
|
-
const l =
|
|
433
|
+
if (s) {
|
|
434
|
+
const l = r.value;
|
|
436
435
|
if (l.length === 1) {
|
|
437
|
-
const
|
|
438
|
-
return
|
|
436
|
+
const n = l[0];
|
|
437
|
+
return n == null ? null : A(e.propertyPath, U.Equals, M(n));
|
|
439
438
|
}
|
|
440
439
|
return A(
|
|
441
440
|
e.propertyPath,
|
|
442
|
-
|
|
441
|
+
U.In,
|
|
443
442
|
M(l)
|
|
444
443
|
);
|
|
445
444
|
}
|
|
446
|
-
const
|
|
447
|
-
return
|
|
445
|
+
const u = r.value;
|
|
446
|
+
return u == null ? null : A(e.propertyPath, e.op, M(u));
|
|
448
447
|
});
|
|
449
|
-
function
|
|
450
|
-
|
|
448
|
+
function c() {
|
|
449
|
+
r.value = s ? ee(e.defaultValue) : Z(e.defaultValue);
|
|
451
450
|
}
|
|
452
|
-
return { value:
|
|
451
|
+
return { value: r, filter: d, reset: c };
|
|
453
452
|
}
|
|
454
453
|
const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt = /* @__PURE__ */ Y({
|
|
455
454
|
name: "YsTextFilterItem",
|
|
@@ -469,37 +468,37 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
469
468
|
/** 占位文本 */
|
|
470
469
|
placeholder: { type: String, default: "请输入" }
|
|
471
470
|
},
|
|
472
|
-
setup(e, { expose:
|
|
473
|
-
const
|
|
474
|
-
function
|
|
475
|
-
const
|
|
476
|
-
t.value = (
|
|
471
|
+
setup(e, { expose: s }) {
|
|
472
|
+
const r = e, { value: t, filter: d, reset: c } = De(r);
|
|
473
|
+
function u(n) {
|
|
474
|
+
const i = n.detail;
|
|
475
|
+
t.value = (i == null ? void 0 : i.value) ?? "";
|
|
477
476
|
}
|
|
478
477
|
const l = {
|
|
479
478
|
get filter() {
|
|
480
|
-
return
|
|
479
|
+
return d.value;
|
|
481
480
|
},
|
|
482
|
-
reset:
|
|
481
|
+
reset: c
|
|
483
482
|
};
|
|
484
|
-
return
|
|
483
|
+
return s(l), (n, i) => (f(), K(O, {
|
|
485
484
|
label: e.label,
|
|
486
485
|
api: l
|
|
487
486
|
}, {
|
|
488
487
|
default: q(() => [
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
o("view", Oe, [
|
|
489
|
+
o("input", {
|
|
491
490
|
class: "yk-filter-item__input",
|
|
492
|
-
value:
|
|
491
|
+
value: B(t),
|
|
493
492
|
placeholder: e.placeholder,
|
|
494
493
|
"placeholder-class": "yk-filter-item__placeholder",
|
|
495
|
-
onInput:
|
|
494
|
+
onInput: u
|
|
496
495
|
}, null, 40, je)
|
|
497
496
|
])
|
|
498
497
|
]),
|
|
499
498
|
_: 1
|
|
500
499
|
}, 8, ["label"]));
|
|
501
500
|
}
|
|
502
|
-
}),
|
|
501
|
+
}), Je = ["value", "start", "end"], Qe = { class: "yk-filter-item__picker" }, mt = /* @__PURE__ */ Y({
|
|
503
502
|
name: "YsDateFilterItem",
|
|
504
503
|
__name: "date-filter-item",
|
|
505
504
|
props: {
|
|
@@ -521,52 +520,52 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
521
520
|
/** 可选范围上限(YYYY-MM-DD),空串表示不限制 */
|
|
522
521
|
end: { type: String, default: "" }
|
|
523
522
|
},
|
|
524
|
-
setup(e, { expose:
|
|
525
|
-
const
|
|
526
|
-
function i
|
|
527
|
-
const
|
|
528
|
-
t.value = (
|
|
523
|
+
setup(e, { expose: s }) {
|
|
524
|
+
const r = e, { value: t, filter: d, reset: c } = Le(r);
|
|
525
|
+
function u(i) {
|
|
526
|
+
const _ = i.detail;
|
|
527
|
+
t.value = (_ == null ? void 0 : _.value) ?? "";
|
|
529
528
|
}
|
|
530
529
|
function l() {
|
|
531
530
|
t.value = "";
|
|
532
531
|
}
|
|
533
|
-
const
|
|
532
|
+
const n = {
|
|
534
533
|
get filter() {
|
|
535
|
-
return
|
|
534
|
+
return d.value;
|
|
536
535
|
},
|
|
537
|
-
reset:
|
|
536
|
+
reset: c
|
|
538
537
|
};
|
|
539
|
-
return
|
|
538
|
+
return s(n), (i, _) => (f(), K(O, {
|
|
540
539
|
label: e.label,
|
|
541
|
-
api:
|
|
540
|
+
api: n
|
|
542
541
|
}, {
|
|
543
542
|
default: q(() => [
|
|
544
|
-
|
|
543
|
+
o("picker", {
|
|
545
544
|
class: "yk-filter-item__picker-trigger",
|
|
546
545
|
mode: "date",
|
|
547
|
-
value:
|
|
546
|
+
value: B(t),
|
|
548
547
|
start: e.start,
|
|
549
548
|
end: e.end,
|
|
550
|
-
onChange:
|
|
549
|
+
onChange: u
|
|
551
550
|
}, [
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
class:
|
|
555
|
-
},
|
|
551
|
+
o("view", Qe, [
|
|
552
|
+
o("text", {
|
|
553
|
+
class: V(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !B(t) }])
|
|
554
|
+
}, $(B(t) || e.placeholder), 3)
|
|
556
555
|
])
|
|
557
|
-
], 40,
|
|
558
|
-
|
|
556
|
+
], 40, Je),
|
|
557
|
+
B(t) ? (f(), m("view", {
|
|
559
558
|
key: 0,
|
|
560
559
|
class: "yk-filter-item__clear",
|
|
561
560
|
onTap: W(l, ["stop"])
|
|
562
|
-
}, [...
|
|
563
|
-
|
|
564
|
-
])], 32)) :
|
|
561
|
+
}, [..._[0] || (_[0] = [
|
|
562
|
+
o("text", null, "✕", -1)
|
|
563
|
+
])], 32)) : w("", !0)
|
|
565
564
|
]),
|
|
566
565
|
_: 1
|
|
567
566
|
}, 8, ["label"]));
|
|
568
567
|
}
|
|
569
|
-
}),
|
|
568
|
+
}), Ue = ["value", "start", "end"], Ge = { class: "yk-filter-item__picker" }, He = ["value", "start", "end"], We = { class: "yk-filter-item__picker" }, vt = /* @__PURE__ */ Y({
|
|
570
569
|
name: "YsDateRangeFilterItem",
|
|
571
570
|
__name: "date-range-filter-item",
|
|
572
571
|
props: {
|
|
@@ -588,72 +587,72 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
588
587
|
/** 可选范围上限(YYYY-MM-DD),空串表示不限制 */
|
|
589
588
|
end: { type: String, default: "" }
|
|
590
589
|
},
|
|
591
|
-
setup(e, { expose:
|
|
592
|
-
const
|
|
593
|
-
function
|
|
594
|
-
const
|
|
595
|
-
S[
|
|
590
|
+
setup(e, { expose: s }) {
|
|
591
|
+
const r = e, { value: t, filter: d, reset: c } = ze(r);
|
|
592
|
+
function u(b, y) {
|
|
593
|
+
const C = t.value ?? ["", ""], S = [C[0], C[1]];
|
|
594
|
+
S[b] = y, t.value = !S[0] && !S[1] ? null : S;
|
|
596
595
|
}
|
|
597
|
-
function l(
|
|
598
|
-
const
|
|
599
|
-
|
|
596
|
+
function l(b) {
|
|
597
|
+
const y = b.detail;
|
|
598
|
+
u(0, (y == null ? void 0 : y.value) ?? "");
|
|
600
599
|
}
|
|
601
|
-
function
|
|
602
|
-
const
|
|
603
|
-
|
|
600
|
+
function n(b) {
|
|
601
|
+
const y = b.detail;
|
|
602
|
+
u(1, (y == null ? void 0 : y.value) ?? "");
|
|
604
603
|
}
|
|
605
|
-
function
|
|
604
|
+
function i() {
|
|
606
605
|
t.value = null;
|
|
607
606
|
}
|
|
608
|
-
const
|
|
607
|
+
const _ = {
|
|
609
608
|
get filter() {
|
|
610
|
-
return
|
|
609
|
+
return d.value;
|
|
611
610
|
},
|
|
612
|
-
reset:
|
|
611
|
+
reset: c
|
|
613
612
|
};
|
|
614
|
-
return
|
|
613
|
+
return s(_), (b, y) => (f(), K(O, {
|
|
615
614
|
label: e.label,
|
|
616
|
-
api:
|
|
615
|
+
api: _
|
|
617
616
|
}, {
|
|
618
617
|
default: q(() => {
|
|
619
|
-
var
|
|
618
|
+
var C, S, T, k, a, h;
|
|
620
619
|
return [
|
|
621
|
-
|
|
620
|
+
o("picker", {
|
|
622
621
|
class: "yk-filter-item__picker-trigger",
|
|
623
622
|
mode: "date",
|
|
624
|
-
value: ((
|
|
623
|
+
value: ((C = B(t)) == null ? void 0 : C[0]) ?? "",
|
|
625
624
|
start: e.start,
|
|
626
625
|
end: e.end,
|
|
627
626
|
onChange: l
|
|
628
627
|
}, [
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
class:
|
|
632
|
-
},
|
|
628
|
+
o("view", Ge, [
|
|
629
|
+
o("text", {
|
|
630
|
+
class: V(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !((S = B(t)) != null && S[0]) }])
|
|
631
|
+
}, $(((T = B(t)) == null ? void 0 : T[0]) || e.startPlaceholder), 3)
|
|
633
632
|
])
|
|
634
|
-
], 40,
|
|
635
|
-
|
|
636
|
-
|
|
633
|
+
], 40, Ue),
|
|
634
|
+
y[1] || (y[1] = o("text", { class: "yk-filter-item__sep" }, "至", -1)),
|
|
635
|
+
o("picker", {
|
|
637
636
|
class: "yk-filter-item__picker-trigger",
|
|
638
637
|
mode: "date",
|
|
639
|
-
value: ((
|
|
638
|
+
value: ((k = B(t)) == null ? void 0 : k[1]) ?? "",
|
|
640
639
|
start: e.start,
|
|
641
640
|
end: e.end,
|
|
642
|
-
onChange:
|
|
641
|
+
onChange: n
|
|
643
642
|
}, [
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
class:
|
|
647
|
-
},
|
|
643
|
+
o("view", We, [
|
|
644
|
+
o("text", {
|
|
645
|
+
class: V(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !((a = B(t)) != null && a[1]) }])
|
|
646
|
+
}, $(((h = B(t)) == null ? void 0 : h[1]) || e.endPlaceholder), 3)
|
|
648
647
|
])
|
|
649
648
|
], 40, He),
|
|
650
|
-
|
|
649
|
+
B(t) ? (f(), m("view", {
|
|
651
650
|
key: 0,
|
|
652
651
|
class: "yk-filter-item__clear",
|
|
653
|
-
onTap: W(
|
|
654
|
-
}, [...
|
|
655
|
-
|
|
656
|
-
])], 32)) :
|
|
652
|
+
onTap: W(i, ["stop"])
|
|
653
|
+
}, [...y[0] || (y[0] = [
|
|
654
|
+
o("text", null, "✕", -1)
|
|
655
|
+
])], 32)) : w("", !0)
|
|
657
656
|
];
|
|
658
657
|
}),
|
|
659
658
|
_: 1
|
|
@@ -689,82 +688,82 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
689
688
|
/** 单选模式是否显示清除按钮 */
|
|
690
689
|
clearable: { type: Boolean, default: !0 }
|
|
691
690
|
},
|
|
692
|
-
setup(e, { expose:
|
|
693
|
-
const
|
|
691
|
+
setup(e, { expose: s }) {
|
|
692
|
+
const r = e, { value: t, filter: d, reset: c } = Ke(r), u = x([]), l = x(!1);
|
|
694
693
|
G(async () => {
|
|
695
694
|
l.value = !0;
|
|
696
695
|
try {
|
|
697
|
-
|
|
696
|
+
u.value = await r.optionsSource();
|
|
698
697
|
} finally {
|
|
699
698
|
l.value = !1;
|
|
700
699
|
}
|
|
701
700
|
});
|
|
702
|
-
const
|
|
703
|
-
const
|
|
704
|
-
return
|
|
705
|
-
}),
|
|
706
|
-
var
|
|
707
|
-
const
|
|
708
|
-
return
|
|
701
|
+
const n = I(() => {
|
|
702
|
+
const k = Array.isArray(t.value) ? null : t.value;
|
|
703
|
+
return k == null ? -1 : u.value.findIndex((a) => String(a.value) === String(k));
|
|
704
|
+
}), i = I(() => {
|
|
705
|
+
var a;
|
|
706
|
+
const k = n.value;
|
|
707
|
+
return k >= 0 ? ((a = u.value[k]) == null ? void 0 : a.label) ?? "" : "";
|
|
709
708
|
});
|
|
710
|
-
function
|
|
711
|
-
const
|
|
712
|
-
|
|
709
|
+
function _(k) {
|
|
710
|
+
const a = k.detail, h = Number((a == null ? void 0 : a.value) ?? -1), F = u.value[h];
|
|
711
|
+
F && (t.value = F.value);
|
|
713
712
|
}
|
|
714
|
-
function
|
|
713
|
+
function b() {
|
|
715
714
|
t.value = null;
|
|
716
715
|
}
|
|
717
|
-
const
|
|
716
|
+
const y = I(
|
|
718
717
|
() => Array.isArray(t.value) ? t.value : []
|
|
719
718
|
);
|
|
720
|
-
function
|
|
721
|
-
return
|
|
719
|
+
function C(k) {
|
|
720
|
+
return y.value.some((a) => String(a) === String(k.value));
|
|
722
721
|
}
|
|
723
|
-
function S(
|
|
724
|
-
const
|
|
725
|
-
|
|
722
|
+
function S(k) {
|
|
723
|
+
const a = [...y.value], h = a.findIndex((F) => String(F) === String(k.value));
|
|
724
|
+
h >= 0 ? a.splice(h, 1) : a.push(k.value), t.value = a;
|
|
726
725
|
}
|
|
727
|
-
const
|
|
726
|
+
const T = {
|
|
728
727
|
get filter() {
|
|
729
|
-
return
|
|
728
|
+
return d.value;
|
|
730
729
|
},
|
|
731
|
-
reset:
|
|
730
|
+
reset: c
|
|
732
731
|
};
|
|
733
|
-
return
|
|
732
|
+
return s(T), (k, a) => (f(), K(O, {
|
|
734
733
|
label: e.label,
|
|
735
|
-
api:
|
|
734
|
+
api: T
|
|
736
735
|
}, {
|
|
737
736
|
default: q(() => [
|
|
738
|
-
e.multiple ? (
|
|
739
|
-
l.value ? (
|
|
740
|
-
key: String(
|
|
741
|
-
class:
|
|
742
|
-
onTap: (
|
|
737
|
+
e.multiple ? (f(), m("view", Xe, [
|
|
738
|
+
l.value ? (f(), m("text", Ze, "加载中…")) : (f(!0), m(L, { key: 1 }, H(u.value, (h) => (f(), m("view", {
|
|
739
|
+
key: String(h.value),
|
|
740
|
+
class: V(["yk-filter-item__chip", { "yk-filter-item__chip--active": C(h) }]),
|
|
741
|
+
onTap: (F) => S(h)
|
|
743
742
|
}, [
|
|
744
|
-
|
|
743
|
+
o("text", null, $(h.label), 1)
|
|
745
744
|
], 42, et))), 128))
|
|
746
|
-
])) : (
|
|
747
|
-
|
|
745
|
+
])) : (f(), m(L, { key: 1 }, [
|
|
746
|
+
o("picker", {
|
|
748
747
|
class: "yk-filter-item__picker-trigger",
|
|
749
748
|
mode: "selector",
|
|
750
|
-
range:
|
|
749
|
+
range: u.value,
|
|
751
750
|
"range-key": "label",
|
|
752
|
-
value:
|
|
753
|
-
onChange:
|
|
751
|
+
value: n.value < 0 ? 0 : n.value,
|
|
752
|
+
onChange: _
|
|
754
753
|
}, [
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
class:
|
|
758
|
-
},
|
|
754
|
+
o("view", lt, [
|
|
755
|
+
o("text", {
|
|
756
|
+
class: V(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !i.value }])
|
|
757
|
+
}, $(l.value ? "加载中…" : i.value || e.placeholder), 3)
|
|
759
758
|
])
|
|
760
759
|
], 40, tt),
|
|
761
|
-
e.clearable &&
|
|
760
|
+
e.clearable && i.value ? (f(), m("view", {
|
|
762
761
|
key: 0,
|
|
763
762
|
class: "yk-filter-item__clear",
|
|
764
|
-
onTap: W(
|
|
765
|
-
}, [...
|
|
766
|
-
|
|
767
|
-
])], 32)) :
|
|
763
|
+
onTap: W(b, ["stop"])
|
|
764
|
+
}, [...a[0] || (a[0] = [
|
|
765
|
+
o("text", null, "✕", -1)
|
|
766
|
+
])], 32)) : w("", !0)
|
|
768
767
|
], 64))
|
|
769
768
|
]),
|
|
770
769
|
_: 1
|
|
@@ -785,28 +784,28 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
785
784
|
customStyle: { type: String, default: "" }
|
|
786
785
|
},
|
|
787
786
|
setup(e) {
|
|
788
|
-
async function
|
|
787
|
+
async function s(r) {
|
|
789
788
|
try {
|
|
790
|
-
await
|
|
789
|
+
await r.execute(void 0);
|
|
791
790
|
} catch (t) {
|
|
792
|
-
console.error("[YsCommandBar] action failed:",
|
|
791
|
+
console.error("[YsCommandBar] action failed:", r.name, t);
|
|
793
792
|
}
|
|
794
793
|
}
|
|
795
|
-
return (
|
|
796
|
-
class:
|
|
794
|
+
return (r, t) => (f(), m("view", {
|
|
795
|
+
class: V(["yk-command-bar", e.customClass]),
|
|
797
796
|
style: z(e.customStyle)
|
|
798
797
|
}, [
|
|
799
|
-
e.actions.length > 0 ? (
|
|
800
|
-
key:
|
|
801
|
-
class:
|
|
802
|
-
|
|
803
|
-
{ "yk-command-bar__btn--plain":
|
|
798
|
+
e.actions.length > 0 ? (f(!0), m(L, { key: 0 }, H(e.actions, (d) => (f(), m("view", {
|
|
799
|
+
key: d.name,
|
|
800
|
+
class: V(["yk-command-bar__btn", [
|
|
801
|
+
d.type ? `yk-command-bar__btn--${d.type}` : "yk-command-bar__btn--default",
|
|
802
|
+
{ "yk-command-bar__btn--plain": d.plain }
|
|
804
803
|
]]),
|
|
805
|
-
onTap: (
|
|
804
|
+
onTap: (c) => s(d)
|
|
806
805
|
}, [
|
|
807
|
-
|
|
808
|
-
], 42, nt))), 128)) :
|
|
809
|
-
|
|
806
|
+
o("text", at, $(d.desc), 1)
|
|
807
|
+
], 42, nt))), 128)) : w("", !0),
|
|
808
|
+
P(r.$slots, "default")
|
|
810
809
|
], 6));
|
|
811
810
|
}
|
|
812
811
|
}), rt = { class: "yk-infinite-page" }, st = {
|
|
@@ -820,8 +819,6 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
820
819
|
__name: "infinite-page",
|
|
821
820
|
props: {
|
|
822
821
|
/* ---------- FilterPanel ---------- */
|
|
823
|
-
/** 文本搜索框的值(v-model 绑定内部 FilterPanel) */
|
|
824
|
-
modelValue: { type: String, default: "" },
|
|
825
822
|
/** 是否渲染顶部 FilterPanel,默认 true */
|
|
826
823
|
showFilter: { type: Boolean, default: !0 },
|
|
827
824
|
/** 文本搜索条件构造委托(FilterPanel 唯一入口) */
|
|
@@ -855,31 +852,27 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
855
852
|
listCustomClass: { type: String, default: "" },
|
|
856
853
|
listCustomStyle: { type: String, default: "" }
|
|
857
854
|
},
|
|
858
|
-
emits: ["
|
|
859
|
-
setup(e, { expose:
|
|
860
|
-
const t =
|
|
861
|
-
|
|
855
|
+
emits: ["search", "reset", "expand-change", "data-loaded", "selection-change", "error"],
|
|
856
|
+
setup(e, { expose: s, emit: r }) {
|
|
857
|
+
const t = r, d = x(null), c = x(null);
|
|
858
|
+
s({
|
|
862
859
|
/** YsInfiniteList 实例(空壳子 CommandBar 没有 list 引用,业务侧通过这个 ref 调 reload / clearSelection 等) */
|
|
863
860
|
get list() {
|
|
864
|
-
return
|
|
861
|
+
return d.value;
|
|
865
862
|
},
|
|
866
863
|
/** YsFilterPanel 实例 */
|
|
867
864
|
get filterPanel() {
|
|
868
|
-
return
|
|
865
|
+
return c.value;
|
|
869
866
|
}
|
|
870
867
|
});
|
|
871
|
-
function
|
|
872
|
-
t("
|
|
868
|
+
function u(l, n) {
|
|
869
|
+
t("data-loaded", l, n);
|
|
873
870
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
return (r, u) => (d(), v("view", rt, [
|
|
878
|
-
e.showFilter ? (d(), v("view", st, [
|
|
879
|
-
J(qe, {
|
|
871
|
+
return (l, n) => (f(), m("view", rt, [
|
|
872
|
+
e.showFilter ? (f(), m("view", st, [
|
|
873
|
+
Q(qe, {
|
|
880
874
|
ref_key: "filterRef",
|
|
881
|
-
ref:
|
|
882
|
-
"model-value": e.modelValue,
|
|
875
|
+
ref: c,
|
|
883
876
|
placeholder: e.placeholder,
|
|
884
877
|
"filter-text": e.filterText,
|
|
885
878
|
"search-button-text": e.searchButtonText,
|
|
@@ -890,21 +883,20 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
890
883
|
"text-filter-builder": e.textFilterBuilder,
|
|
891
884
|
"custom-class": e.filterCustomClass,
|
|
892
885
|
"custom-style": e.filterCustomStyle,
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
onExpandChange: u[2] || (u[2] = (h) => t("expand-change", h))
|
|
886
|
+
onSearch: n[0] || (n[0] = (i) => t("search", i)),
|
|
887
|
+
onReset: n[1] || (n[1] = (i) => t("reset")),
|
|
888
|
+
onExpandChange: n[2] || (n[2] = (i) => t("expand-change", i))
|
|
897
889
|
}, {
|
|
898
890
|
default: q(() => [
|
|
899
|
-
|
|
891
|
+
P(l.$slots, "filter-default")
|
|
900
892
|
]),
|
|
901
893
|
_: 3
|
|
902
|
-
}, 8, ["
|
|
903
|
-
])) :
|
|
904
|
-
|
|
905
|
-
|
|
894
|
+
}, 8, ["placeholder", "filter-text", "search-button-text", "reset-button-text", "default-expanded", "show-search", "show-reset", "text-filter-builder", "custom-class", "custom-style"])
|
|
895
|
+
])) : w("", !0),
|
|
896
|
+
o("view", ut, [
|
|
897
|
+
Q(Fe, {
|
|
906
898
|
ref_key: "listRef",
|
|
907
|
-
ref:
|
|
899
|
+
ref: d,
|
|
908
900
|
"data-fun": e.dataFun,
|
|
909
901
|
"page-size": e.pageSize,
|
|
910
902
|
threshold: e.threshold,
|
|
@@ -912,33 +904,33 @@ const Oe = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
|
|
|
912
904
|
immediate: e.immediate,
|
|
913
905
|
"show-checkbox": e.showCheckbox,
|
|
914
906
|
height: "100%",
|
|
915
|
-
class:
|
|
907
|
+
class: V(e.listCustomClass),
|
|
916
908
|
style: z(e.listCustomStyle),
|
|
917
|
-
onDataLoaded:
|
|
918
|
-
onSelectionChange:
|
|
919
|
-
onError:
|
|
909
|
+
onDataLoaded: n[3] || (n[3] = (i, _) => u(i, _)),
|
|
910
|
+
onSelectionChange: n[4] || (n[4] = (i) => t("selection-change", i)),
|
|
911
|
+
onError: n[5] || (n[5] = (i) => t("error", i))
|
|
920
912
|
}, {
|
|
921
|
-
default: q(({ row:
|
|
922
|
-
|
|
923
|
-
row:
|
|
924
|
-
index:
|
|
913
|
+
default: q(({ row: i, index: _ }) => [
|
|
914
|
+
P(l.$slots, "list-default", {
|
|
915
|
+
row: i,
|
|
916
|
+
index: _
|
|
925
917
|
})
|
|
926
918
|
]),
|
|
927
919
|
_: 3
|
|
928
920
|
}, 8, ["data-fun", "page-size", "threshold", "row-key", "immediate", "show-checkbox", "class", "style"])
|
|
929
921
|
]),
|
|
930
|
-
e.showCommandBar ? (
|
|
931
|
-
|
|
922
|
+
e.showCommandBar ? (f(), m("view", ot, [
|
|
923
|
+
Q(it, {
|
|
932
924
|
actions: e.actions,
|
|
933
925
|
"custom-class": e.cmdCustomClass,
|
|
934
926
|
"custom-style": e.cmdCustomStyle
|
|
935
927
|
}, {
|
|
936
928
|
default: q(() => [
|
|
937
|
-
|
|
929
|
+
P(l.$slots, "cmd-default")
|
|
938
930
|
]),
|
|
939
931
|
_: 3
|
|
940
932
|
}, 8, ["actions", "custom-class", "custom-style"])
|
|
941
|
-
])) :
|
|
933
|
+
])) : w("", !0)
|
|
942
934
|
]));
|
|
943
935
|
}
|
|
944
936
|
});
|