@vanstack/solid-ark 0.0.37 → 0.0.39

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.
@@ -1,7 +1,7 @@
1
1
  import "../solid-ark.css";
2
2
  import { t as e } from "../button-Br_upy12.js";
3
3
  import { t } from "../badge-Dt0uZnmA.js";
4
- import { t as n } from "../form-D59udNG7.js";
4
+ import { t as n } from "../form-jqVwcqEp.js";
5
5
  import { t as r } from "../table-ByBUErrC.js";
6
6
  import { className as i, createComponent as a, effect as o, insert as s, memo as c, setAttribute as l, setStyleProperty as u, template as d, use as f } from "solid-js/web";
7
7
  import { For as p, Show as m, createEffect as ee, createMemo as h, createSignal as g, mergeProps as _, on as te, onCleanup as v, onMount as y } from "solid-js";
@@ -275,7 +275,11 @@ function V(c) {
275
275
  sorting: n
276
276
  }), Q = 0, $ = async (e, t) => {
277
277
  if (S()) {
278
- c.onSearch(e, t);
278
+ c.onSearch?.(e, t);
279
+ return;
280
+ }
281
+ if (!c.onSearch) {
282
+ console.error("非受控模式下请定义onSearch事件");
279
283
  return;
280
284
  }
281
285
  let n = ++Q;
@@ -61,7 +61,7 @@ export interface DataTableProps<TData, TSearch extends Record<string, unknown> =
61
61
  /** 是否显示搜索区底部的"重置/查询"按钮,默认 true */
62
62
  showSearchActions?: boolean;
63
63
  /** 取数函数:内部模式挂载/查询/重置/翻页/排序时调用,受控模式仅作为变化通知 */
64
- onSearch: DataTableSearchHandler<TData, TSearch>;
64
+ onSearch?: DataTableSearchHandler<TData, TSearch>;
65
65
  /** 表格数据:传入则受控渲染 props.data;不传则由 onSearch 结果内部维护 */
66
66
  data?: TData[];
67
67
  /** 总条数:受控模式配合 data 使用,不传回退为 data.length */
@@ -1,3 +1,3 @@
1
1
  import "../solid-ark.css";
2
- import { t as e } from "../form-D59udNG7.js";
2
+ import { t as e } from "../form-jqVwcqEp.js";
3
3
  export { e as Form };