@ys-knife-crud/taro 0.0.5 → 0.0.7

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