@vanstack/solid-ark 0.0.36 → 0.0.38

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-CGmUE_ol.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";
@@ -1,6 +1,11 @@
1
- import { FieldConfig } from '../type';
1
+ import { FieldConfig, FieldRuleContext } from '../type';
2
2
  export declare function isFieldType<T extends FieldConfig["fieldType"]>(field: FieldConfig, type: T): field is Extract<FieldConfig, {
3
3
  fieldType: T;
4
4
  }>;
5
5
  /** 宽度配置 → CSS 值:数字转 px,字符串原样 */
6
6
  export declare function toCssWidth(width: number | string | undefined): string | undefined;
7
+ /**
8
+ * 必填默认规则:值为空(undefined / null / "" / 空数组)时返回 `${label}必填`;
9
+ * false 视为已填(checkbox/switch 未选中也是合法值)。
10
+ */
11
+ export declare function buildRequiredRule(label?: string): (props: FieldRuleContext) => string | undefined;
@@ -1,3 +1,3 @@
1
1
  import "../solid-ark.css";
2
- import { t as e } from "../form-CGmUE_ol.js";
2
+ import { t as e } from "../form-jqVwcqEp.js";
3
3
  export { e as Form };
@@ -19,6 +19,8 @@ interface BaseFieldConfig {
19
19
  rule?: FieldRule;
20
20
  /** 这些字段变化时重新触发本字段校验(跨字段规则) */
21
21
  validateListenTo?: string[];
22
+ /** 是否必填:true 且未配置 rule 时自动注入必填校验(空值判定:undefined/null/""/空数组,false 视为已填),错误消息为 `${label}必填`;label 前显示必填星号 */
23
+ required?: boolean;
22
24
  /** 自定义控件(优先级高于 fieldType) */
23
25
  control?: (props: FieldControlProps) => JSX.Element;
24
26
  /** 自定义 label */