x-runtime-lib 0.9.38 → 0.9.40

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.
@@ -247,6 +247,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
247
247
  max: "Max",
248
248
  maxErrors: "Max Errors",
249
249
  maxHeight: "Max Height",
250
+ maxLength: "Max Length",
250
251
  maxRows: "Max Rows",
251
252
  maxWidth: "Max Width",
252
253
  medium: "Medium",
@@ -258,6 +259,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
258
259
  middle: "Middle",
259
260
  min: "Min",
260
261
  minHeight: "Min Height",
262
+ minLength: "Min Length",
261
263
  minWidth: "Min Width",
262
264
  misc: "Misc",
263
265
  mode: "Mode",
@@ -329,6 +331,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
329
331
  regular: "Regular",
330
332
  relative: "Relative",
331
333
  renderSwitch: "Render Switch",
334
+ required: "Required",
332
335
  reset: "Reset",
333
336
  resetValidation: "Reset Validation",
334
337
  result: "Result",
@@ -340,6 +343,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
340
343
  rowKey: "Row Key",
341
344
  rowReverse: "Row Reverse",
342
345
  rows: "Rows",
346
+ rules: "Rules",
343
347
  runtime: "Runtime",
344
348
  scale: "Scale",
345
349
  secondary: "Secondary",
@@ -247,6 +247,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
247
247
  max: "最大值",
248
248
  maxErrors: "最大错误数",
249
249
  maxHeight: "最大高度",
250
+ maxLength: "最大长度",
250
251
  maxRows: "最大行数",
251
252
  maxWidth: "最大宽度",
252
253
  medium: "中",
@@ -258,6 +259,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
258
259
  middle: "中",
259
260
  min: "最小值",
260
261
  minHeight: "最小高度",
262
+ minLength: "最小长度",
261
263
  minWidth: "最小宽度",
262
264
  misc: "杂项",
263
265
  mode: "模式",
@@ -329,6 +331,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
329
331
  regular: "常规",
330
332
  relative: "相对",
331
333
  renderSwitch: "渲染开关",
334
+ required: "必填",
332
335
  reset: "重置",
333
336
  resetValidation: "重置验证",
334
337
  result: "结果",
@@ -340,6 +343,7 @@ var t = /* @__PURE__ */ e({ default: () => n }), n = { "x-runtime-lib": {
340
343
  rowKey: "行键",
341
344
  rowReverse: "行反向",
342
345
  rows: "行数",
346
+ rules: "规则(s)",
343
347
  runtime: "运行时",
344
348
  scale: "缩放",
345
349
  secondary: "次要",
package/dist/index.d.ts CHANGED
@@ -188,7 +188,7 @@ export declare function getNodeLite(nodeLites: NodeLite[], id: string): NodeLite
188
188
 
189
189
  export declare function getPropertyDefault(property: ZProperty): any;
190
190
 
191
- export declare function getPropertyDefaultArray(property: ZProperty): any[] | string[] | number[] | boolean[];
191
+ export declare function getPropertyDefaultArray(property: ZProperty): any[] | string[] | number[] | boolean[] | ("" | "required" | "email" | "minLength" | "maxLength" | "length")[];
192
192
 
193
193
  export declare function getRadius(val: unknown): string | undefined;
194
194
 
@@ -491,6 +491,8 @@ export declare function regTypes(key: ZTypesKey, types: ZType[]): void;
491
491
 
492
492
  export declare const reverseBreakpoints: readonly ["xl", "lg", "md", "sm", "xs"];
493
493
 
494
+ export declare const rules: readonly ["required", "email", "minLength", "maxLength", "length"];
495
+
494
496
  declare class Sandbox {
495
497
  kind: SandboxKind;
496
498
  nodeId: string;
@@ -836,7 +838,7 @@ export declare type ZProperty = ({
836
838
  } & ZPropertyBranch) | ({
837
839
  array: true;
838
840
  defaultArray: any[];
839
- } & ZPropertyBranch) | WithArray<ZPropertyDummy> | WithArray<ZPropertyText> | WithArray<ZPropertyNumber> | WithArray<ZPropertySwitch> | WithArray<ZPropertySelect> | WithArray<ZPropertyJson> | WithArray<ZPropertyIcon> | WithArray<ZPropertyMultiTypes> | WithArray<ZPropertyComp> | WithArray<ZPropertySlot> | WithArray<ZPropertyAdaptSlot> | WithArray<ZPropertyInlineSlot> | WithArray<ZPropertyTransient<Type>>;
841
+ } & ZPropertyBranch) | WithArray<ZPropertyDummy> | WithArray<ZPropertyText> | WithArray<ZPropertyNumber> | WithArray<ZPropertySwitch> | WithArray<ZPropertySelect> | WithArray<ZPropertyJson> | WithArray<ZPropertyIcon> | WithArray<ZPropertyComp> | WithArray<ZPropertySlot> | WithArray<ZPropertyAdaptSlot> | WithArray<ZPropertyInlineSlot> | WithArray<ZPropertyRule> | WithArray<ZPropertyMultiTypes> | WithArray<ZPropertyTransient<Type>>;
840
842
 
841
843
  declare type ZPropertyAdaptSlot = {
842
844
  ui: 'adaptSlot';
@@ -898,6 +900,11 @@ declare type ZPropertyNumber = {
898
900
  default: number;
899
901
  } & ZPropertyBase;
900
902
 
903
+ declare type ZPropertyRule = {
904
+ ui: 'rule';
905
+ default: ZRule | '';
906
+ } & ZPropertyBase;
907
+
901
908
  declare type ZPropertySelect = {
902
909
  ui: 'select';
903
910
  items: ZItemsKey;
@@ -943,6 +950,8 @@ declare type ZPropertyTransient<T extends Type> = {
943
950
  };
944
951
  }[T];
945
952
 
953
+ export declare type ZRule = (typeof rules)[number];
954
+
946
955
  export declare type ZSlot = {
947
956
  key: string;
948
957
  name: string;