@ys-knife-crud/taro 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +503 -463
  4. package/dist/index.js.map +1 -1
  5. package/dist/taro/src/components/filter-panel/index.d.ts +1 -0
  6. package/dist/taro/src/components/filter-panel/index.d.ts.map +1 -1
  7. package/dist/taro/src/index.d.ts +1 -0
  8. package/dist/taro/src/index.d.ts.map +1 -1
  9. package/package.json +10 -9
  10. package/src/components/command-bar/README.md +170 -0
  11. package/src/components/command-bar/command-bar.vue +135 -0
  12. package/src/components/filter-item/README.md +126 -0
  13. package/src/components/filter-item/date-filter-item.vue +87 -0
  14. package/src/components/filter-item/date-range-filter-item.vue +121 -0
  15. package/src/components/filter-item/enum-filter-item.vue +168 -0
  16. package/src/components/filter-item/filter-item-layout.vue +172 -0
  17. package/src/components/filter-item/index.ts +5 -0
  18. package/src/components/filter-item/text-filter-item.vue +70 -0
  19. package/src/components/filter-item/use-filter-item.ts +205 -0
  20. package/src/components/filter-panel/README.md +278 -0
  21. package/src/components/filter-panel/context.ts +43 -0
  22. package/src/components/filter-panel/filter-panel.vue +302 -0
  23. package/src/components/filter-panel/index.ts +2 -0
  24. package/src/components/filter-panel/root-filter-panel.vue +86 -0
  25. package/src/components/infinite-list/index.ts +1 -0
  26. package/src/components/infinite-list/infinite-list.vue +451 -0
  27. package/src/components/infinite-page/README.md +201 -0
  28. package/src/components/infinite-page/infinite-page.vue +284 -0
  29. package/src/index.ts +13 -0
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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
- import { createSelectorQuery as ye } from "@tarojs/taro";
3
- import { emptyFilter as me, FilterInfo as ve, filter as A, con as N, Operator as U } from "@ys-knife-crud/core";
1
+ import { defineComponent as T, ref as _, computed as $, watch as X, getCurrentInstance as ie, onMounted as G, openBlock as f, createElementBlock as m, normalizeStyle as z, createElementVNode as c, Fragment as L, renderList as H, normalizeClass as R, createCommentVNode as S, renderSlot as B, toDisplayString as C, nextTick as re, inject as se, onBeforeUnmount as ue, shallowRef as oe, provide as ce, useSlots as fe, withDirectives as de, createVNode as D, withCtx as E, vShow as ye, createBlock as K, unref as I, withModifiers as W } from "vue";
2
+ import { createSelectorQuery as me } from "@tarojs/taro";
3
+ import { emptyFilter as te, FilterInfo as ve, filter as A, con as N, Operator as U } from "@ys-knife-crud/core";
4
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"
@@ -16,7 +16,7 @@ import './index.css';const ge = ["lower-threshold"], he = { class: "yk-infinite-
16
16
  }, $e = {
17
17
  key: 3,
18
18
  class: "yk-infinite-list__no-more"
19
- }, Fe = /* @__PURE__ */ Y({
19
+ }, Fe = /* @__PURE__ */ T({
20
20
  name: "YsInfiniteList",
21
21
  __name: "infinite-list",
22
22
  props: {
@@ -47,172 +47,213 @@ import './index.css';const ge = ["lower-threshold"], he = { class: "yk-infinite-
47
47
  showCheckbox: { type: Boolean, default: !1 }
48
48
  },
49
49
  emits: ["data-loaded", "error", "selection-change"],
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]));
50
+ setup(t, { expose: s, emit: r }) {
51
+ const l = t, a = r, u = _([]), o = _(!1), e = _(!1), n = _(!0), i = _(null), k = _(0), b = $(() => u.value.length), y = _(/* @__PURE__ */ new Map()), F = $(() => [...y.value.values()]);
52
+ function x(g) {
53
+ return y.value.has(String(g[l.rowKey]));
54
54
  }
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;
55
+ function P(g, p) {
56
+ const h = String(g[l.rowKey]), Y = new Map(y.value), M = Y.has(h), q = p ?? !M;
57
+ q && !M ? Y.set(h, g) : !q && M && Y.delete(h), y.value = Y;
58
58
  }
59
- function k() {
59
+ function d() {
60
60
  y.value = /* @__PURE__ */ new Map();
61
61
  }
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;
62
+ function v() {
63
+ const g = new Map(y.value);
64
+ for (const p of u.value) g.set(String(p[l.rowKey]), p);
65
+ y.value = g;
66
66
  }
67
- function g() {
68
- const v = new Map(y.value);
69
- for (const p of o.value) {
67
+ function w() {
68
+ const g = new Map(y.value);
69
+ for (const p of u.value) {
70
70
  const h = String(p[l.rowKey]);
71
- v.has(h) ? v.delete(h) : v.set(h, p);
71
+ g.has(h) ? g.delete(h) : g.set(h, p);
72
72
  }
73
- y.value = v;
73
+ y.value = g;
74
74
  }
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;
75
+ X(F, (g) => a("selection-change", [...g]));
76
+ async function V(g) {
77
+ if (g) {
78
+ if (e.value || o.value || !n.value) return;
79
+ e.value = !0;
80
80
  } else {
81
- if (c.value) return;
82
- c.value = !0, i.value = null;
81
+ if (o.value) return;
82
+ o.value = !0, i.value = null;
83
83
  }
84
84
  try {
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);
85
+ const p = g ? b.value : 0, h = await l.dataFun({ limit: l.pageSize, offset: p });
86
+ g ? u.value.push(...h.items) : u.value = h.items, n.value = h.hasNext ?? !1, h.totalCount != null && (k.value = h.totalCount), a("data-loaded", h, g);
87
87
  } catch (p) {
88
88
  i.value = p, a("error", p);
89
89
  } finally {
90
- v ? t.value = !1 : c.value = !1, i.value || ne();
90
+ g ? e.value = !1 : o.value = !1, i.value || ae();
91
91
  }
92
92
  }
93
- function j() {
94
- F(!0);
93
+ function J() {
94
+ V(!0);
95
95
  }
96
- function D() {
97
- n.value = !0, F(!1);
96
+ function O() {
97
+ n.value = !0, V(!1);
98
98
  }
99
- function le() {
100
- n.value && !c.value && !t.value && j();
99
+ function ne() {
100
+ n.value && !o.value && !e.value && J();
101
101
  }
102
- const J = ae();
103
- async function ne() {
104
- if (!n.value || c.value || t.value) return;
105
- await ie();
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();
102
+ const Q = ie();
103
+ async function ae() {
104
+ if (!n.value || o.value || e.value) return;
105
+ await re();
106
+ const g = Q == null ? void 0 : Q.proxy;
107
+ g && await new Promise((p) => {
108
+ me().in(g).select(".yk-infinite-list").boundingClientRect().select(".yk-infinite-list__content").boundingClientRect().exec((h) => {
109
+ const Y = h ?? [], M = Y[0], q = Y[1];
110
+ M && q && q.height <= M.height + 1 && J(), p();
111
111
  });
112
112
  });
113
113
  }
114
114
  return G(() => {
115
- l.immediate && F(!1);
116
- }), X(() => l.dataFun, () => D()), u({
115
+ l.immediate && V(!1);
116
+ }), X(() => l.dataFun, () => O()), s({
117
117
  /** 当前已加载的全部数据 */
118
- items: o,
118
+ items: u,
119
119
  /** 首屏加载态 */
120
- loading: c,
120
+ loading: o,
121
121
  /** 追加加载态 */
122
- loadingMore: t,
122
+ loadingMore: e,
123
123
  /** 是否还有下一页 */
124
124
  hasMore: n,
125
125
  /** 重置并从第一页重新加载 */
126
- reload: D,
126
+ reload: O,
127
127
  /** 刷新:重置为第一页重新加载(与 YsTable 的 refresh 同名同义) */
128
- refresh: D,
128
+ refresh: O,
129
129
  /** 手动触发加载下一页(一般由触底自动触发) */
130
- loadNextPage: j,
130
+ loadNextPage: J,
131
131
  /** rows 别名:当前已加载的全部数据(与 YsTable 的 rows 同名) */
132
- rows: o,
132
+ rows: u,
133
133
  /** 跨页累计选中的行(showCheckbox 开启时有意义) */
134
- selectedRows: C,
134
+ selectedRows: F,
135
135
  /** 某行当前是否选中 */
136
- isRowSelected: S,
136
+ isRowSelected: x,
137
137
  /** 切换某行选中态(selected 缺省时取反) */
138
138
  toggleRowSelection: P,
139
139
  /** 清空全部选中 */
140
- clearSelection: k,
140
+ clearSelection: d,
141
141
  /** 选中当前已加载的全部行 */
142
- selectAllOnPage: r,
142
+ selectAllOnPage: v,
143
143
  /** 反选当前已加载的行 */
144
- invertSelectionOnPage: g
145
- }), (v, p) => (d(), m("scroll-view", {
144
+ invertSelectionOnPage: w
145
+ }), (g, p) => (f(), m("scroll-view", {
146
146
  class: "yk-infinite-list",
147
- style: O({ height: e.height }),
147
+ style: z({ height: t.height }),
148
148
  "scroll-y": "",
149
- "lower-threshold": e.threshold,
150
- onScrolltolower: le
149
+ "lower-threshold": t.threshold,
150
+ onScrolltolower: ne
151
151
  }, [
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) }])
152
+ c("view", he, [
153
+ (f(!0), m(L, null, H(u.value, (h, Y) => (f(), m("view", {
154
+ key: String(h[t.rowKey]),
155
+ class: R(["yk-infinite-list__item", { "is-selected": t.showCheckbox && x(h) }])
156
156
  }, [
157
- e.showCheckbox ? (d(), m("view", {
157
+ t.showCheckbox ? (f(), m("view", {
158
158
  key: 0,
159
- class: R(["yk-infinite-list__item-checkbox", { "is-checked": S(h) }]),
160
- onTap: (E) => P(h)
159
+ class: R(["yk-infinite-list__item-checkbox", { "is-checked": x(h) }]),
160
+ onTap: (M) => P(h)
161
161
  }, [
162
- S(h) ? (d(), m("text", ke, "✓")) : w("", !0)
163
- ], 42, pe)) : w("", !0),
164
- f("view", _e, [
165
- T(v.$slots, "default", {
162
+ x(h) ? (f(), m("text", ke, "✓")) : S("", !0)
163
+ ], 42, pe)) : S("", !0),
164
+ c("view", _e, [
165
+ B(g.$slots, "default", {
166
166
  row: h,
167
- index: V
167
+ index: Y
168
168
  }, () => [
169
- f("text", xe, $(JSON.stringify(h)), 1)
169
+ c("text", xe, C(JSON.stringify(h)), 1)
170
170
  ])
171
171
  ])
172
172
  ], 2))), 128)),
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))
173
+ !o.value && u.value.length === 0 && !i.value ? (f(), m("view", Se, [
174
+ B(g.$slots, "empty", {}, () => [
175
+ p[0] || (p[0] = c("text", { class: "yk-infinite-list__status-text" }, "暂无数据", -1))
176
176
  ])
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", {
177
+ ])) : i.value ? (f(), m("view", we, [
178
+ B(g.$slots, "error", { error: i.value }, () => [
179
+ c("text", be, "加载失败:" + C(String(i.value)), 1),
180
+ c("button", {
181
181
  class: "yk-infinite-list__retry",
182
182
  size: "mini",
183
- onTap: D
183
+ onTap: O
184
184
  }, "重试", 32)
185
185
  ])
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))
186
+ ])) : S("", !0),
187
+ e.value ? (f(), m("view", Ce, [
188
+ B(g.$slots, "loading", {}, () => [
189
+ p[1] || (p[1] = c("view", { class: "yk-infinite-list__spinner" }, null, -1)),
190
+ p[2] || (p[2] = c("text", null, "加载中...", -1))
191
191
  ])
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))
192
+ ])) : S("", !0),
193
+ !n.value && u.value.length > 0 && !o.value ? (f(), m("view", $e, [
194
+ B(g.$slots, "no-more", {}, () => [
195
+ p[3] || (p[3] = c("text", null, "— 没有更多了 —", -1))
196
196
  ])
197
- ])) : w("", !0)
197
+ ])) : S("", !0)
198
198
  ])
199
199
  ], 44, ge));
200
200
  }
201
- }), te = Symbol("YsFilterPanel");
202
- function Be(e) {
203
- const u = re(te, null);
204
- if (!u) return;
205
- let s = null;
201
+ }), le = Symbol("YsFilterPanel");
202
+ function Ie(t) {
203
+ const s = se(le, null);
204
+ if (!s) return;
205
+ let r = null;
206
206
  G(() => {
207
- s = u(e);
208
- }), se(() => {
209
- s == null || s(), s = null;
207
+ r = s(t);
208
+ }), ue(() => {
209
+ r == null || r(), r = null;
210
210
  });
211
211
  }
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 = {
212
+ const Be = /* @__PURE__ */ T({
213
+ name: "YsRootFilterPanel",
214
+ __name: "root-filter-panel",
215
+ props: {
216
+ /**
217
+ * 外部追加条件:与插槽内子项的条件按 AND 合并。
218
+ * 传 null / 不传时忽略;每次变化(引用变化)都会触发聚合重算,
219
+ * 因此推荐传入 computed 派生出的 FilterInfo。
220
+ */
221
+ extraFilter: {
222
+ type: Object,
223
+ default: null
224
+ }
225
+ },
226
+ setup(t, { expose: s }) {
227
+ const r = t, l = oe([]);
228
+ function a(e) {
229
+ return l.value = [...l.value, e], () => {
230
+ l.value = l.value.filter((n) => n !== e);
231
+ };
232
+ }
233
+ ce(le, a);
234
+ const u = $(() => {
235
+ const e = [];
236
+ r.extraFilter && e.push(r.extraFilter);
237
+ for (const n of l.value) {
238
+ const i = n.filter;
239
+ i && e.push(i);
240
+ }
241
+ return e.length === 0 ? te() : e.length === 1 ? e[0] : ve.createAnd(...e);
242
+ });
243
+ function o() {
244
+ for (const e of l.value) e.reset();
245
+ }
246
+ return s({
247
+ /** 当前聚合后的查询条件(extraFilter AND 所有子项) */
248
+ filter: u,
249
+ /** 重置所有已注册子项(extraFilter 由外部自行维护) */
250
+ reset: o
251
+ }), (e, n) => B(e.$slots, "default");
252
+ }
253
+ }), Pe = { class: "yk-filter-panel__bar" }, Re = { class: "yk-filter-panel__trigger-text" }, Te = { class: "yk-filter-panel__arrow" }, Ve = { class: "yk-filter-panel__field" }, Ye = ["value", "placeholder"], Ee = { class: "yk-filter-panel__actions" }, Me = {
213
254
  key: 0,
214
255
  class: "yk-filter-panel__conditions"
215
- }, Me = /* @__PURE__ */ Y({
256
+ }, Ae = /* @__PURE__ */ T({
216
257
  name: "YsFilterPanel",
217
258
  __name: "filter-panel",
218
259
  props: {
@@ -254,103 +295,101 @@ const Ie = { class: "yk-filter-panel__bar" }, Pe = { class: "yk-filter-panel__tr
254
295
  customStyle: { type: String, default: "" }
255
296
  },
256
297
  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);
262
- };
263
- }
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);
298
+ setup(t, { expose: s, emit: r }) {
299
+ const l = t, a = r, u = fe(), o = $(() => !!u.default), e = _(l.defaultExpanded), n = _(""), i = _(null), k = $(() => {
300
+ const d = n.value.trim();
301
+ return !d || !l.textFilterBuilder ? null : l.textFilterBuilder(d) ?? null;
302
+ }), b = $(
303
+ () => {
304
+ var d;
305
+ return ((d = i.value) == null ? void 0 : d.filter) ?? te();
274
306
  }
275
- return r.length === 0 ? me() : r.length === 1 ? r[0] : ve.createAnd(...r);
276
- });
277
- function C() {
278
- t.value = !t.value, a("expand-change", t.value);
307
+ );
308
+ function y() {
309
+ e.value = !e.value, a("expand-change", e.value);
279
310
  }
280
- function S(r) {
281
- const g = r.detail;
282
- n.value = (g == null ? void 0 : g.value) ?? "";
311
+ function F(d) {
312
+ const v = d.detail;
313
+ n.value = (v == null ? void 0 : v.value) ?? "";
283
314
  }
284
- function P() {
285
- a("search", y.value);
315
+ function x() {
316
+ a("search", b.value);
286
317
  }
287
- function k() {
288
- n.value = "";
289
- for (const r of i.value) r.reset();
290
- a("reset");
318
+ function P() {
319
+ var d;
320
+ n.value = "", (d = i.value) == null || d.reset(), a("reset");
291
321
  }
292
- return u({
322
+ return s({
293
323
  /** 文本搜索框当前值(只读读取用,外部不能写入) */
294
324
  keyword: n,
295
325
  /** 条件区是否展开 */
296
- expanded: t,
326
+ expanded: e,
297
327
  /** 当前聚合后的查询条件 */
298
- filter: y,
328
+ filter: b,
299
329
  /** 切换条件区展开/折叠 */
300
- toggle: C,
330
+ toggle: y,
301
331
  /** 重置(清空文本 + 重置已注册子项 + 派发 reset) */
302
- reset: k
303
- }), (r, g) => (d(), m("view", {
304
- class: R(["yk-filter-panel", e.customClass]),
305
- style: O(e.customStyle)
332
+ reset: P
333
+ }), (d, v) => (f(), m("view", {
334
+ class: R(["yk-filter-panel", t.customClass]),
335
+ style: z(t.customStyle)
306
336
  }, [
307
- f("view", Ie, [
308
- c.value ? (d(), m("view", {
337
+ c("view", Pe, [
338
+ o.value ? (f(), m("view", {
309
339
  key: 0,
310
340
  class: "yk-filter-panel__trigger",
311
- onTap: C
341
+ onTap: y
312
342
  }, [
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", {
343
+ c("text", Re, C(t.filterText), 1),
344
+ c("text", Te, C(e.value ? "▲" : "▼"), 1)
345
+ ], 32)) : S("", !0),
346
+ c("view", Ve, [
347
+ c("input", {
318
348
  class: "yk-filter-panel__input",
319
349
  value: n.value,
320
- placeholder: e.placeholder,
350
+ placeholder: t.placeholder,
321
351
  "placeholder-class": "yk-filter-panel__placeholder",
322
- onInput: S,
323
- onConfirm: P
324
- }, null, 40, Ve)
352
+ onInput: F,
353
+ onConfirm: x
354
+ }, null, 40, Ye)
325
355
  ]),
326
- f("view", Ye, [
327
- e.showSearch ? (d(), m("view", {
356
+ c("view", Ee, [
357
+ t.showSearch ? (f(), m("view", {
328
358
  key: 0,
329
359
  class: "yk-filter-panel__btn yk-filter-panel__btn--primary",
330
- onTap: P
360
+ onTap: x
331
361
  }, [
332
- f("text", null, $(e.searchButtonText), 1)
333
- ], 32)) : w("", !0),
334
- e.showReset ? (d(), m("view", {
362
+ c("text", null, C(t.searchButtonText), 1)
363
+ ], 32)) : S("", !0),
364
+ t.showReset ? (f(), m("view", {
335
365
  key: 1,
336
366
  class: "yk-filter-panel__btn yk-filter-panel__btn--default",
337
- onTap: k
367
+ onTap: P
338
368
  }, [
339
- f("text", null, $(e.resetButtonText), 1)
340
- ], 32)) : w("", !0)
369
+ c("text", null, C(t.resetButtonText), 1)
370
+ ], 32)) : S("", !0)
341
371
  ])
342
372
  ]),
343
- c.value ? fe((d(), m("view", Ee, [
344
- T(r.$slots, "default")
373
+ o.value ? de((f(), m("view", Me, [
374
+ D(Be, {
375
+ ref_key: "rootRef",
376
+ ref: i,
377
+ "extra-filter": k.value
378
+ }, {
379
+ default: E(() => [
380
+ B(d.$slots, "default")
381
+ ]),
382
+ _: 3
383
+ }, 8, ["extra-filter"])
345
384
  ], 512)), [
346
- [de, t.value]
347
- ]) : w("", !0)
385
+ [ye, e.value]
386
+ ]) : S("", !0)
348
387
  ], 6));
349
388
  }
350
- }), Ae = { class: "yk-filter-item" }, Ne = {
389
+ }), Ne = { class: "yk-filter-item" }, qe = {
351
390
  key: 0,
352
391
  class: "yk-filter-item__label"
353
- }, qe = { class: "yk-filter-item__control" }, K = /* @__PURE__ */ Y({
392
+ }, Oe = { class: "yk-filter-item__control" }, j = /* @__PURE__ */ T({
354
393
  name: "YsFilterItemLayout",
355
394
  __name: "filter-item-layout",
356
395
  props: {
@@ -359,98 +398,98 @@ const Ie = { class: "yk-filter-panel__bar" }, Pe = { class: "yk-filter-panel__tr
359
398
  /** FilterItem 的 API 对象,由 layout 注册到最近的 YsFilterPanel */
360
399
  api: { type: Object, required: !0 }
361
400
  },
362
- setup(e) {
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")
401
+ setup(t) {
402
+ return Ie(t.api), (r, l) => (f(), m("view", Ne, [
403
+ t.label ? (f(), m("text", qe, C(t.label), 1)) : S("", !0),
404
+ c("view", Oe, [
405
+ B(r.$slots, "default")
367
406
  ])
368
407
  ]));
369
408
  }
370
409
  });
371
- function De(e) {
372
- const u = x(
373
- typeof e.defaultValue == "string" ? e.defaultValue : ""
410
+ function De(t) {
411
+ const s = _(
412
+ typeof t.defaultValue == "string" ? t.defaultValue : ""
374
413
  );
375
- function s(o) {
376
- return o == null || o.trim() === "";
414
+ function r(u) {
415
+ return u == null || u.trim() === "";
377
416
  }
378
- const l = I(() => s(u.value) ? null : A(e.propertyPath, e.op, N(u.value)));
417
+ const l = $(() => r(s.value) ? null : A(t.propertyPath, t.op, N(s.value)));
379
418
  function a() {
380
- u.value = typeof e.defaultValue == "string" ? e.defaultValue : "";
419
+ s.value = typeof t.defaultValue == "string" ? t.defaultValue : "";
381
420
  }
382
- return { value: u, filter: l, reset: a };
421
+ return { value: s, filter: l, reset: a };
383
422
  }
384
- function Le(e) {
385
- const u = x(
386
- typeof e.defaultValue == "string" ? e.defaultValue : ""
423
+ function Le(t) {
424
+ const s = _(
425
+ typeof t.defaultValue == "string" ? t.defaultValue : ""
387
426
  );
388
- function s(o) {
389
- return o == null || o.trim() === "";
427
+ function r(u) {
428
+ return u == null || u.trim() === "";
390
429
  }
391
- const l = I(() => s(u.value) ? null : A(e.propertyPath, e.op, N(u.value)));
430
+ const l = $(() => r(s.value) ? null : A(t.propertyPath, t.op, N(s.value)));
392
431
  function a() {
393
- u.value = typeof e.defaultValue == "string" ? e.defaultValue : "";
432
+ s.value = typeof t.defaultValue == "string" ? t.defaultValue : "";
394
433
  }
395
- return { value: u, filter: l, reset: a };
434
+ return { value: s, filter: l, reset: a };
396
435
  }
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;
436
+ function ze(t) {
437
+ function s(e) {
438
+ return e && e.length === 2 && typeof e[0] == "string" && typeof e[1] == "string" ? [e[0], e[1]] : null;
400
439
  }
401
- const s = u(e.defaultValue), l = x(s);
402
- function a(t) {
403
- return t == null || t.length !== 2 || !t[0] || !t[1];
440
+ const r = s(t.defaultValue), l = _(r);
441
+ function a(e) {
442
+ return e == null || e.length !== 2 || !e[0] || !e[1];
404
443
  }
405
- const o = I(() => {
444
+ const u = $(() => {
406
445
  if (a(l.value)) return null;
407
- const [t, n] = l.value;
408
- return A(e.propertyPath, U.Between, N([t, n]));
446
+ const [e, n] = l.value;
447
+ return A(t.propertyPath, U.Between, N([e, n]));
409
448
  });
410
- function c() {
411
- l.value = s;
449
+ function o() {
450
+ l.value = r;
412
451
  }
413
- return { value: l, filter: o, reset: c };
452
+ return { value: l, filter: u, reset: o };
414
453
  }
415
- function Z(e) {
416
- return typeof e == "string" || typeof e == "number" ? e : null;
454
+ function Z(t) {
455
+ return typeof t == "string" || typeof t == "number" ? t : null;
417
456
  }
418
- function ee(e) {
419
- return Array.isArray(e) ? e.filter(
420
- (u) => typeof u == "string" || typeof u == "number"
457
+ function ee(t) {
458
+ return Array.isArray(t) ? t.filter(
459
+ (s) => typeof s == "string" || typeof s == "number"
421
460
  ) : [];
422
461
  }
423
- function ze(e) {
424
- const u = e.multiple === !0, s = x(
425
- u ? ee(e.defaultValue) : Z(e.defaultValue)
462
+ function Ke(t) {
463
+ const s = t.multiple === !0, r = _(
464
+ s ? ee(t.defaultValue) : Z(t.defaultValue)
426
465
  );
427
466
  function l() {
428
- const c = s.value;
429
- return u ? !Array.isArray(c) || c.length === 0 : c == null || typeof c == "string" && c.trim() === "";
467
+ const o = r.value;
468
+ return s ? !Array.isArray(o) || o.length === 0 : o == null || typeof o == "string" && o.trim() === "";
430
469
  }
431
- const a = I(() => {
470
+ const a = $(() => {
432
471
  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));
472
+ if (s) {
473
+ const e = r.value;
474
+ if (e.length === 1) {
475
+ const n = e[0];
476
+ return n == null ? null : A(t.propertyPath, U.Equals, N(n));
438
477
  }
439
478
  return A(
440
- e.propertyPath,
479
+ t.propertyPath,
441
480
  U.In,
442
- N(t)
481
+ N(e)
443
482
  );
444
483
  }
445
- const c = s.value;
446
- return c == null ? null : A(e.propertyPath, e.op, N(c));
484
+ const o = r.value;
485
+ return o == null ? null : A(t.propertyPath, t.op, N(o));
447
486
  });
448
- function o() {
449
- s.value = u ? ee(e.defaultValue) : Z(e.defaultValue);
487
+ function u() {
488
+ r.value = s ? ee(t.defaultValue) : Z(t.defaultValue);
450
489
  }
451
- return { value: s, filter: a, reset: o };
490
+ return { value: r, filter: a, reset: u };
452
491
  }
453
- const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt = /* @__PURE__ */ Y({
492
+ const je = { class: "yk-filter-item__field" }, Je = ["value", "placeholder"], mt = /* @__PURE__ */ T({
454
493
  name: "YsTextFilterItem",
455
494
  __name: "text-filter-item",
456
495
  props: {
@@ -468,37 +507,37 @@ const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
468
507
  /** 占位文本 */
469
508
  placeholder: { type: String, default: "请输入" }
470
509
  },
471
- setup(e, { expose: u }) {
472
- const s = e, { value: l, filter: a, reset: o } = De(s);
473
- function c(n) {
510
+ setup(t, { expose: s }) {
511
+ const r = t, { value: l, filter: a, reset: u } = De(r);
512
+ function o(n) {
474
513
  const i = n.detail;
475
514
  l.value = (i == null ? void 0 : i.value) ?? "";
476
515
  }
477
- const t = {
516
+ const e = {
478
517
  get filter() {
479
518
  return a.value;
480
519
  },
481
- reset: o
520
+ reset: u
482
521
  };
483
- return u(t), (n, i) => (d(), z(K, {
484
- label: e.label,
485
- api: t
522
+ return s(e), (n, i) => (f(), K(j, {
523
+ label: t.label,
524
+ api: e
486
525
  }, {
487
- default: M(() => [
488
- f("view", Ke, [
489
- f("input", {
526
+ default: E(() => [
527
+ c("view", je, [
528
+ c("input", {
490
529
  class: "yk-filter-item__input",
491
- value: B(l),
492
- placeholder: e.placeholder,
530
+ value: I(l),
531
+ placeholder: t.placeholder,
493
532
  "placeholder-class": "yk-filter-item__placeholder",
494
- onInput: c
495
- }, null, 40, je)
533
+ onInput: o
534
+ }, null, 40, Je)
496
535
  ])
497
536
  ]),
498
537
  _: 1
499
538
  }, 8, ["label"]));
500
539
  }
501
- }), Je = ["value", "start", "end"], Qe = { class: "yk-filter-item__picker" }, mt = /* @__PURE__ */ Y({
540
+ }), Qe = ["value", "start", "end"], Ue = { class: "yk-filter-item__picker" }, vt = /* @__PURE__ */ T({
502
541
  name: "YsDateFilterItem",
503
542
  __name: "date-filter-item",
504
543
  props: {
@@ -520,52 +559,52 @@ const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
520
559
  /** 可选范围上限(YYYY-MM-DD),空串表示不限制 */
521
560
  end: { type: String, default: "" }
522
561
  },
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) ?? "";
562
+ setup(t, { expose: s }) {
563
+ const r = t, { value: l, filter: a, reset: u } = Le(r);
564
+ function o(i) {
565
+ const k = i.detail;
566
+ l.value = (k == null ? void 0 : k.value) ?? "";
528
567
  }
529
- function t() {
568
+ function e() {
530
569
  l.value = "";
531
570
  }
532
571
  const n = {
533
572
  get filter() {
534
573
  return a.value;
535
574
  },
536
- reset: o
575
+ reset: u
537
576
  };
538
- return u(n), (i, _) => (d(), z(K, {
539
- label: e.label,
577
+ return s(n), (i, k) => (f(), K(j, {
578
+ label: t.label,
540
579
  api: n
541
580
  }, {
542
- default: M(() => [
543
- f("picker", {
581
+ default: E(() => [
582
+ c("picker", {
544
583
  class: "yk-filter-item__picker-trigger",
545
584
  mode: "date",
546
- value: B(l),
547
- start: e.start,
548
- end: e.end,
549
- onChange: c
585
+ value: I(l),
586
+ start: t.start,
587
+ end: t.end,
588
+ onChange: o
550
589
  }, [
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)
590
+ c("view", Ue, [
591
+ c("text", {
592
+ class: R(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !I(l) }])
593
+ }, C(I(l) || t.placeholder), 3)
555
594
  ])
556
- ], 40, Je),
557
- B(l) ? (d(), m("view", {
595
+ ], 40, Qe),
596
+ I(l) ? (f(), m("view", {
558
597
  key: 0,
559
598
  class: "yk-filter-item__clear",
560
- onTap: W(t, ["stop"])
561
- }, [..._[0] || (_[0] = [
562
- f("text", null, "✕", -1)
563
- ])], 32)) : w("", !0)
599
+ onTap: W(e, ["stop"])
600
+ }, [...k[0] || (k[0] = [
601
+ c("text", null, "✕", -1)
602
+ ])], 32)) : S("", !0)
564
603
  ]),
565
604
  _: 1
566
605
  }, 8, ["label"]));
567
606
  }
568
- }), Ue = ["value", "start", "end"], Ge = { class: "yk-filter-item__picker" }, He = ["value", "start", "end"], We = { class: "yk-filter-item__picker" }, vt = /* @__PURE__ */ Y({
607
+ }), Ge = ["value", "start", "end"], He = { class: "yk-filter-item__picker" }, We = ["value", "start", "end"], Xe = { class: "yk-filter-item__picker" }, gt = /* @__PURE__ */ T({
569
608
  name: "YsDateRangeFilterItem",
570
609
  __name: "date-range-filter-item",
571
610
  props: {
@@ -587,84 +626,84 @@ const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
587
626
  /** 可选范围上限(YYYY-MM-DD),空串表示不限制 */
588
627
  end: { type: String, default: "" }
589
628
  },
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;
629
+ setup(t, { expose: s }) {
630
+ const r = t, { value: l, filter: a, reset: u } = ze(r);
631
+ function o(b, y) {
632
+ const F = l.value ?? ["", ""], x = [F[0], F[1]];
633
+ x[b] = y, l.value = !x[0] && !x[1] ? null : x;
595
634
  }
596
- function t(b) {
635
+ function e(b) {
597
636
  const y = b.detail;
598
- c(0, (y == null ? void 0 : y.value) ?? "");
637
+ o(0, (y == null ? void 0 : y.value) ?? "");
599
638
  }
600
639
  function n(b) {
601
640
  const y = b.detail;
602
- c(1, (y == null ? void 0 : y.value) ?? "");
641
+ o(1, (y == null ? void 0 : y.value) ?? "");
603
642
  }
604
643
  function i() {
605
644
  l.value = null;
606
645
  }
607
- const _ = {
646
+ const k = {
608
647
  get filter() {
609
648
  return a.value;
610
649
  },
611
- reset: o
650
+ reset: u
612
651
  };
613
- return u(_), (b, y) => (d(), z(K, {
614
- label: e.label,
615
- api: _
652
+ return s(k), (b, y) => (f(), K(j, {
653
+ label: t.label,
654
+ api: k
616
655
  }, {
617
- default: M(() => {
618
- var C, S, P, k, r, g;
656
+ default: E(() => {
657
+ var F, x, P, d, v, w;
619
658
  return [
620
- f("picker", {
659
+ c("picker", {
621
660
  class: "yk-filter-item__picker-trigger",
622
661
  mode: "date",
623
- value: ((C = B(l)) == null ? void 0 : C[0]) ?? "",
624
- start: e.start,
625
- end: e.end,
626
- onChange: t
662
+ value: ((F = I(l)) == null ? void 0 : F[0]) ?? "",
663
+ start: t.start,
664
+ end: t.end,
665
+ onChange: e
627
666
  }, [
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)
667
+ c("view", He, [
668
+ c("text", {
669
+ class: R(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !((x = I(l)) != null && x[0]) }])
670
+ }, C(((P = I(l)) == null ? void 0 : P[0]) || t.startPlaceholder), 3)
632
671
  ])
633
- ], 40, Ue),
634
- y[1] || (y[1] = f("text", { class: "yk-filter-item__sep" }, "至", -1)),
635
- f("picker", {
672
+ ], 40, Ge),
673
+ y[1] || (y[1] = c("text", { class: "yk-filter-item__sep" }, "至", -1)),
674
+ c("picker", {
636
675
  class: "yk-filter-item__picker-trigger",
637
676
  mode: "date",
638
- value: ((k = B(l)) == null ? void 0 : k[1]) ?? "",
639
- start: e.start,
640
- end: e.end,
677
+ value: ((d = I(l)) == null ? void 0 : d[1]) ?? "",
678
+ start: t.start,
679
+ end: t.end,
641
680
  onChange: n
642
681
  }, [
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)
682
+ c("view", Xe, [
683
+ c("text", {
684
+ class: R(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !((v = I(l)) != null && v[1]) }])
685
+ }, C(((w = I(l)) == null ? void 0 : w[1]) || t.endPlaceholder), 3)
647
686
  ])
648
- ], 40, He),
649
- B(l) ? (d(), m("view", {
687
+ ], 40, We),
688
+ I(l) ? (f(), m("view", {
650
689
  key: 0,
651
690
  class: "yk-filter-item__clear",
652
691
  onTap: W(i, ["stop"])
653
692
  }, [...y[0] || (y[0] = [
654
- f("text", null, "✕", -1)
655
- ])], 32)) : w("", !0)
693
+ c("text", null, "✕", -1)
694
+ ])], 32)) : S("", !0)
656
695
  ];
657
696
  }),
658
697
  _: 1
659
698
  }, 8, ["label"]));
660
699
  }
661
- }), Xe = {
700
+ }), Ze = {
662
701
  key: 0,
663
702
  class: "yk-filter-item__chips"
664
- }, Ze = {
703
+ }, et = {
665
704
  key: 0,
666
705
  class: "yk-filter-item__chips-empty"
667
- }, et = ["onTap"], tt = ["range", "value"], lt = { class: "yk-filter-item__picker" }, gt = /* @__PURE__ */ Y({
706
+ }, tt = ["onTap"], lt = ["range", "value"], nt = { class: "yk-filter-item__picker" }, ht = /* @__PURE__ */ T({
668
707
  name: "YsEnumFilterItem",
669
708
  __name: "enum-filter-item",
670
709
  props: {
@@ -688,88 +727,88 @@ const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
688
727
  /** 单选模式是否显示清除按钮 */
689
728
  clearable: { type: Boolean, default: !0 }
690
729
  },
691
- setup(e, { expose: u }) {
692
- const s = e, { value: l, filter: a, reset: o } = ze(s), c = x([]), t = x(!1);
730
+ setup(t, { expose: s }) {
731
+ const r = t, { value: l, filter: a, reset: u } = Ke(r), o = _([]), e = _(!1);
693
732
  G(async () => {
694
- t.value = !0;
733
+ e.value = !0;
695
734
  try {
696
- c.value = await s.optionsSource();
735
+ o.value = await r.optionsSource();
697
736
  } finally {
698
- t.value = !1;
737
+ e.value = !1;
699
738
  }
700
739
  });
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) ?? "" : "";
740
+ const n = $(() => {
741
+ const d = Array.isArray(l.value) ? null : l.value;
742
+ return d == null ? -1 : o.value.findIndex((v) => String(v.value) === String(d));
743
+ }), i = $(() => {
744
+ var v;
745
+ const d = n.value;
746
+ return d >= 0 ? ((v = o.value[d]) == null ? void 0 : v.label) ?? "" : "";
708
747
  });
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);
748
+ function k(d) {
749
+ const v = d.detail, w = Number((v == null ? void 0 : v.value) ?? -1), V = o.value[w];
750
+ V && (l.value = V.value);
712
751
  }
713
752
  function b() {
714
753
  l.value = null;
715
754
  }
716
- const y = I(
755
+ const y = $(
717
756
  () => Array.isArray(l.value) ? l.value : []
718
757
  );
719
- function C(k) {
720
- return y.value.some((r) => String(r) === String(k.value));
758
+ function F(d) {
759
+ return y.value.some((v) => String(v) === String(d.value));
721
760
  }
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;
761
+ function x(d) {
762
+ const v = [...y.value], w = v.findIndex((V) => String(V) === String(d.value));
763
+ w >= 0 ? v.splice(w, 1) : v.push(d.value), l.value = v;
725
764
  }
726
765
  const P = {
727
766
  get filter() {
728
767
  return a.value;
729
768
  },
730
- reset: o
769
+ reset: u
731
770
  };
732
- return u(P), (k, r) => (d(), z(K, {
733
- label: e.label,
771
+ return s(P), (d, v) => (f(), K(j, {
772
+ label: t.label,
734
773
  api: P
735
774
  }, {
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)
775
+ default: E(() => [
776
+ t.multiple ? (f(), m("view", Ze, [
777
+ e.value ? (f(), m("text", et, "加载中…")) : (f(!0), m(L, { key: 1 }, H(o.value, (w) => (f(), m("view", {
778
+ key: String(w.value),
779
+ class: R(["yk-filter-item__chip", { "yk-filter-item__chip--active": F(w) }]),
780
+ onTap: (V) => x(w)
742
781
  }, [
743
- f("text", null, $(g.label), 1)
744
- ], 42, et))), 128))
745
- ])) : (d(), m(L, { key: 1 }, [
746
- f("picker", {
782
+ c("text", null, C(w.label), 1)
783
+ ], 42, tt))), 128))
784
+ ])) : (f(), m(L, { key: 1 }, [
785
+ c("picker", {
747
786
  class: "yk-filter-item__picker-trigger",
748
787
  mode: "selector",
749
- range: c.value,
788
+ range: o.value,
750
789
  "range-key": "label",
751
790
  value: n.value < 0 ? 0 : n.value,
752
- onChange: _
791
+ onChange: k
753
792
  }, [
754
- f("view", lt, [
755
- f("text", {
793
+ c("view", nt, [
794
+ c("text", {
756
795
  class: R(["yk-filter-item__picker-text", { "yk-filter-item__picker-text--placeholder": !i.value }])
757
- }, $(t.value ? "加载中…" : i.value || e.placeholder), 3)
796
+ }, C(e.value ? "加载中…" : i.value || t.placeholder), 3)
758
797
  ])
759
- ], 40, tt),
760
- e.clearable && i.value ? (d(), m("view", {
798
+ ], 40, lt),
799
+ t.clearable && i.value ? (f(), m("view", {
761
800
  key: 0,
762
801
  class: "yk-filter-item__clear",
763
802
  onTap: W(b, ["stop"])
764
- }, [...r[0] || (r[0] = [
765
- f("text", null, "✕", -1)
766
- ])], 32)) : w("", !0)
803
+ }, [...v[0] || (v[0] = [
804
+ c("text", null, "✕", -1)
805
+ ])], 32)) : S("", !0)
767
806
  ], 64))
768
807
  ]),
769
808
  _: 1
770
809
  }, 8, ["label"]));
771
810
  }
772
- }), nt = ["onTap"], at = { class: "yk-command-bar__btn-text" }, it = /* @__PURE__ */ Y({
811
+ }), at = ["onTap"], it = { class: "yk-command-bar__btn-text" }, rt = /* @__PURE__ */ T({
773
812
  name: "YsCommandBar",
774
813
  __name: "command-bar",
775
814
  props: {
@@ -783,38 +822,38 @@ const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
783
822
  /** 外部自定义样式:追加到根节点上的内联样式字符串 */
784
823
  customStyle: { type: String, default: "" }
785
824
  },
786
- setup(e) {
787
- async function u(s) {
825
+ setup(t) {
826
+ async function s(r) {
788
827
  try {
789
- await s.execute(void 0);
828
+ await r.execute(void 0);
790
829
  } catch (l) {
791
- console.error("[YsCommandBar] action failed:", s.name, l);
830
+ console.error("[YsCommandBar] action failed:", r.name, l);
792
831
  }
793
832
  }
794
- return (s, l) => (d(), m("view", {
795
- class: R(["yk-command-bar", e.customClass]),
796
- style: O(e.customStyle)
833
+ return (r, l) => (f(), m("view", {
834
+ class: R(["yk-command-bar", t.customClass]),
835
+ style: z(t.customStyle)
797
836
  }, [
798
- e.actions.length > 0 ? (d(!0), m(L, { key: 0 }, H(e.actions, (a) => (d(), m("view", {
837
+ t.actions.length > 0 ? (f(!0), m(L, { key: 0 }, H(t.actions, (a) => (f(), m("view", {
799
838
  key: a.name,
800
839
  class: R(["yk-command-bar__btn", [
801
840
  a.type ? `yk-command-bar__btn--${a.type}` : "yk-command-bar__btn--default",
802
841
  { "yk-command-bar__btn--plain": a.plain }
803
842
  ]]),
804
- onTap: (o) => u(a)
843
+ onTap: (u) => s(a)
805
844
  }, [
806
- f("text", at, $(a.desc), 1)
807
- ], 42, nt))), 128)) : w("", !0),
808
- T(s.$slots, "default")
845
+ c("text", it, C(a.desc), 1)
846
+ ], 42, at))), 128)) : S("", !0),
847
+ B(r.$slots, "default")
809
848
  ], 6));
810
849
  }
811
- }), rt = { class: "yk-infinite-page" }, st = {
850
+ }), st = { class: "yk-infinite-page" }, ut = {
812
851
  key: 0,
813
852
  class: "yk-infinite-page__filter"
814
- }, ut = { class: "yk-infinite-page__list" }, ot = {
853
+ }, ot = { class: "yk-infinite-page__list" }, ct = {
815
854
  key: 1,
816
855
  class: "yk-infinite-page__cmd"
817
- }, ht = /* @__PURE__ */ Y({
856
+ }, pt = /* @__PURE__ */ T({
818
857
  name: "YsInfinitePage",
819
858
  __name: "infinite-page",
820
859
  props: {
@@ -853,107 +892,107 @@ const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
853
892
  listCustomStyle: { type: String, default: "" }
854
893
  },
855
894
  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({
895
+ setup(t, { expose: s, emit: r }) {
896
+ const l = r, a = _(null), u = _(null);
897
+ s({
859
898
  /* ---------- 数据加载(转发 YsInfiniteList) ---------- */
860
899
  /** 重置并从第一页重新加载 */
861
900
  reload: () => {
862
- var t;
863
- return (t = a.value) == null ? void 0 : t.reload();
901
+ var e;
902
+ return (e = a.value) == null ? void 0 : e.reload();
864
903
  },
865
904
  /** 刷新:重置为第一页重新加载(与 reload 同义) */
866
905
  refresh: () => {
867
- var t;
868
- return (t = a.value) == null ? void 0 : t.refresh();
906
+ var e;
907
+ return (e = a.value) == null ? void 0 : e.refresh();
869
908
  },
870
909
  /** 手动加载下一页(一般触底自动触发,无需手动调) */
871
910
  loadNextPage: () => {
872
- var t;
873
- return (t = a.value) == null ? void 0 : t.loadNextPage();
911
+ var e;
912
+ return (e = a.value) == null ? void 0 : e.loadNextPage();
874
913
  },
875
914
  /* ---------- 列表状态 ---------- */
876
915
  /** 当前已加载的全部数据 */
877
916
  get items() {
878
- var t;
879
- return ((t = a.value) == null ? void 0 : t.items) ?? [];
917
+ var e;
918
+ return ((e = a.value) == null ? void 0 : e.items) ?? [];
880
919
  },
881
920
  /** items 别名(与 YsTable 的 rows 同名) */
882
921
  get rows() {
883
- var t;
884
- return ((t = a.value) == null ? void 0 : t.rows) ?? [];
922
+ var e;
923
+ return ((e = a.value) == null ? void 0 : e.rows) ?? [];
885
924
  },
886
925
  /** 首屏加载态 */
887
926
  get loading() {
888
- var t;
889
- return ((t = a.value) == null ? void 0 : t.loading) ?? !1;
927
+ var e;
928
+ return ((e = a.value) == null ? void 0 : e.loading) ?? !1;
890
929
  },
891
930
  /** 追加加载态 */
892
931
  get loadingMore() {
893
- var t;
894
- return ((t = a.value) == null ? void 0 : t.loadingMore) ?? !1;
932
+ var e;
933
+ return ((e = a.value) == null ? void 0 : e.loadingMore) ?? !1;
895
934
  },
896
935
  /** 是否还有下一页 */
897
936
  get hasMore() {
898
- var t;
899
- return ((t = a.value) == null ? void 0 : t.hasMore) ?? !1;
937
+ var e;
938
+ return ((e = a.value) == null ? void 0 : e.hasMore) ?? !1;
900
939
  },
901
940
  /* ---------- 多选(showCheckbox 开启时有意义) ---------- */
902
941
  /** 跨页累计选中的行 */
903
942
  get selectedRows() {
904
- var t;
905
- return ((t = a.value) == null ? void 0 : t.selectedRows) ?? [];
943
+ var e;
944
+ return ((e = a.value) == null ? void 0 : e.selectedRows) ?? [];
906
945
  },
907
946
  /** 某行当前是否选中 */
908
- isRowSelected: (t) => {
947
+ isRowSelected: (e) => {
909
948
  var n;
910
- return ((n = a.value) == null ? void 0 : n.isRowSelected(t)) ?? !1;
949
+ return ((n = a.value) == null ? void 0 : n.isRowSelected(e)) ?? !1;
911
950
  },
912
951
  /** 切换某行选中态(selected 缺省时取反) */
913
- toggleRowSelection: (t, n) => {
952
+ toggleRowSelection: (e, n) => {
914
953
  var i;
915
- return (i = a.value) == null ? void 0 : i.toggleRowSelection(t, n);
954
+ return (i = a.value) == null ? void 0 : i.toggleRowSelection(e, n);
916
955
  },
917
956
  /** 清空全部选中 */
918
957
  clearSelection: () => {
919
- var t;
920
- return (t = a.value) == null ? void 0 : t.clearSelection();
958
+ var e;
959
+ return (e = a.value) == null ? void 0 : e.clearSelection();
921
960
  },
922
961
  /** 选中当前已加载的全部行 */
923
962
  selectAllOnPage: () => {
924
- var t;
925
- return (t = a.value) == null ? void 0 : t.selectAllOnPage();
963
+ var e;
964
+ return (e = a.value) == null ? void 0 : e.selectAllOnPage();
926
965
  },
927
966
  /** 反选当前已加载的行 */
928
967
  invertSelectionOnPage: () => {
929
- var t;
930
- return (t = a.value) == null ? void 0 : t.invertSelectionOnPage();
968
+ var e;
969
+ return (e = a.value) == null ? void 0 : e.invertSelectionOnPage();
931
970
  },
932
971
  /* ---------- 筛选面板(转发 YsFilterPanel) ---------- */
933
972
  /** 文本搜索框当前值 */
934
973
  get keyword() {
935
- var t;
936
- return ((t = o.value) == null ? void 0 : t.keyword) ?? "";
974
+ var e;
975
+ return ((e = u.value) == null ? void 0 : e.keyword) ?? "";
937
976
  },
938
977
  /** 当前聚合后的查询条件 */
939
978
  get filter() {
940
- var t;
941
- return (t = o.value) == null ? void 0 : t.filter;
979
+ var e;
980
+ return (e = u.value) == null ? void 0 : e.filter;
942
981
  },
943
982
  /** 条件区是否展开 */
944
983
  get filterExpanded() {
945
- var t;
946
- return ((t = o.value) == null ? void 0 : t.expanded) ?? !1;
984
+ var e;
985
+ return ((e = u.value) == null ? void 0 : e.expanded) ?? !1;
947
986
  },
948
987
  /** 切换条件区展开/折叠 */
949
988
  toggleFilter: () => {
950
- var t;
951
- return (t = o.value) == null ? void 0 : t.toggle();
989
+ var e;
990
+ return (e = u.value) == null ? void 0 : e.toggle();
952
991
  },
953
992
  /** 重置筛选(清空文本 + 重置已注册子项 + 派发 reset) */
954
993
  resetFilter: () => {
955
- var t;
956
- return (t = o.value) == null ? void 0 : t.reset();
994
+ var e;
995
+ return (e = u.value) == null ? void 0 : e.reset();
957
996
  },
958
997
  /* ---------- 子组件实例(未平铺能力的逃生舱) ---------- */
959
998
  /** YsInfiniteList 实例 */
@@ -962,89 +1001,90 @@ const Ke = { class: "yk-filter-item__field" }, je = ["value", "placeholder"], yt
962
1001
  },
963
1002
  /** YsFilterPanel 实例 */
964
1003
  get filterPanel() {
965
- return o.value;
1004
+ return u.value;
966
1005
  }
967
1006
  });
968
- function c(t, n) {
969
- l("data-loaded", t, n);
1007
+ function o(e, n) {
1008
+ l("data-loaded", e, n);
970
1009
  }
971
- return (t, n) => (d(), m("view", rt, [
972
- e.showFilter ? (d(), m("view", st, [
973
- Q(Me, {
1010
+ return (e, n) => (f(), m("view", st, [
1011
+ t.showFilter ? (f(), m("view", ut, [
1012
+ D(Ae, {
974
1013
  ref_key: "filterRef",
975
- ref: o,
976
- placeholder: e.placeholder,
977
- "filter-text": e.filterText,
978
- "search-button-text": e.searchButtonText,
979
- "reset-button-text": e.resetButtonText,
980
- "default-expanded": e.defaultExpanded,
981
- "show-search": e.showSearch,
982
- "show-reset": e.showReset,
983
- "text-filter-builder": e.textFilterBuilder,
984
- "custom-class": e.filterCustomClass,
985
- "custom-style": e.filterCustomStyle,
1014
+ ref: u,
1015
+ placeholder: t.placeholder,
1016
+ "filter-text": t.filterText,
1017
+ "search-button-text": t.searchButtonText,
1018
+ "reset-button-text": t.resetButtonText,
1019
+ "default-expanded": t.defaultExpanded,
1020
+ "show-search": t.showSearch,
1021
+ "show-reset": t.showReset,
1022
+ "text-filter-builder": t.textFilterBuilder,
1023
+ "custom-class": t.filterCustomClass,
1024
+ "custom-style": t.filterCustomStyle,
986
1025
  onSearch: n[0] || (n[0] = (i) => l("search", i)),
987
1026
  onReset: n[1] || (n[1] = (i) => l("reset")),
988
1027
  onExpandChange: n[2] || (n[2] = (i) => l("expand-change", i))
989
1028
  }, {
990
- default: M(() => [
991
- T(t.$slots, "filter-default")
1029
+ default: E(() => [
1030
+ B(e.$slots, "filter-default")
992
1031
  ]),
993
1032
  _: 3
994
1033
  }, 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, {
1034
+ ])) : S("", !0),
1035
+ c("view", ot, [
1036
+ D(Fe, {
998
1037
  ref_key: "listRef",
999
1038
  ref: a,
1000
- "data-fun": e.dataFun,
1001
- "page-size": e.pageSize,
1002
- threshold: e.threshold,
1003
- "row-key": e.rowKey,
1004
- immediate: e.immediate,
1005
- "show-checkbox": e.showCheckbox,
1039
+ "data-fun": t.dataFun,
1040
+ "page-size": t.pageSize,
1041
+ threshold: t.threshold,
1042
+ "row-key": t.rowKey,
1043
+ immediate: t.immediate,
1044
+ "show-checkbox": t.showCheckbox,
1006
1045
  height: "100%",
1007
- class: R(e.listCustomClass),
1008
- style: O(e.listCustomStyle),
1009
- onDataLoaded: n[3] || (n[3] = (i, _) => c(i, _)),
1046
+ class: R(t.listCustomClass),
1047
+ style: z(t.listCustomStyle),
1048
+ onDataLoaded: n[3] || (n[3] = (i, k) => o(i, k)),
1010
1049
  onSelectionChange: n[4] || (n[4] = (i) => l("selection-change", i)),
1011
1050
  onError: n[5] || (n[5] = (i) => l("error", i))
1012
1051
  }, {
1013
- default: M(({ row: i, index: _ }) => [
1014
- T(t.$slots, "list-default", {
1052
+ default: E(({ row: i, index: k }) => [
1053
+ B(e.$slots, "list-default", {
1015
1054
  row: i,
1016
- index: _
1055
+ index: k
1017
1056
  })
1018
1057
  ]),
1019
1058
  _: 3
1020
1059
  }, 8, ["data-fun", "page-size", "threshold", "row-key", "immediate", "show-checkbox", "class", "style"])
1021
1060
  ]),
1022
- e.showCommandBar ? (d(), m("view", ot, [
1023
- Q(it, {
1024
- actions: e.actions,
1025
- "custom-class": e.cmdCustomClass,
1026
- "custom-style": e.cmdCustomStyle
1061
+ t.showCommandBar ? (f(), m("view", ct, [
1062
+ D(rt, {
1063
+ actions: t.actions,
1064
+ "custom-class": t.cmdCustomClass,
1065
+ "custom-style": t.cmdCustomStyle
1027
1066
  }, {
1028
- default: M(() => [
1029
- T(t.$slots, "cmd-default")
1067
+ default: E(() => [
1068
+ B(e.$slots, "cmd-default")
1030
1069
  ]),
1031
1070
  _: 3
1032
1071
  }, 8, ["actions", "custom-class", "custom-style"])
1033
- ])) : w("", !0)
1072
+ ])) : S("", !0)
1034
1073
  ]));
1035
1074
  }
1036
1075
  });
1037
1076
  export {
1038
- te as FilterPanelKey,
1039
- it as YsCommandBar,
1040
- mt as YsDateFilterItem,
1041
- vt as YsDateRangeFilterItem,
1042
- gt as YsEnumFilterItem,
1043
- K as YsFilterItemLayout,
1044
- Me as YsFilterPanel,
1077
+ le as FilterPanelKey,
1078
+ rt as YsCommandBar,
1079
+ vt as YsDateFilterItem,
1080
+ gt as YsDateRangeFilterItem,
1081
+ ht as YsEnumFilterItem,
1082
+ j as YsFilterItemLayout,
1083
+ Ae as YsFilterPanel,
1045
1084
  Fe as YsInfiniteList,
1046
- ht as YsInfinitePage,
1047
- yt as YsTextFilterItem,
1048
- Be as useFilterPanelItem
1085
+ pt as YsInfinitePage,
1086
+ Be as YsRootFilterPanel,
1087
+ mt as YsTextFilterItem,
1088
+ Ie as useFilterPanelItem
1049
1089
  };
1050
1090
  //# sourceMappingURL=index.js.map