dont default minLength

This commit is contained in:
Matt Hill
2023-04-20 12:48:08 -06:00
parent ce1c383944
commit 137371f071
2 changed files with 14 additions and 17 deletions

View File

@@ -29,7 +29,6 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
warning?: string | null; warning?: string | null;
/** Default = [] */ /** Default = [] */
default?: string[]; default?: string[];
/** Default = 0 */
minLength?: number | null; minLength?: number | null;
maxLength?: number | null; maxLength?: number | null;
}, },
@@ -58,7 +57,7 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
warning: null, warning: null,
default: [], default: [],
type: "list" as const, type: "list" as const,
minLength: 0, minLength: null,
maxLength: null, maxLength: null,
...a, ...a,
spec, spec,
@@ -71,7 +70,6 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
warning?: string | null; warning?: string | null;
/** Default = [] */ /** Default = [] */
default?: string[]; default?: string[];
/** Default = 0 */
minLength?: number | null; minLength?: number | null;
maxLength?: number | null; maxLength?: number | null;
}, },
@@ -96,7 +94,7 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
return new List({ return new List({
description: null, description: null,
warning: null, warning: null,
minLength: 0, minLength: null,
maxLength: null, maxLength: null,
default: [], default: [],
type: "list" as const, type: "list" as const,
@@ -111,7 +109,6 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
warning?: string | null; warning?: string | null;
/** Default [] */ /** Default [] */
default?: []; default?: [];
/** Default = 0 */
minLength?: number | null; minLength?: number | null;
maxLength?: number | null; maxLength?: number | null;
}, },
@@ -138,7 +135,7 @@ export class List<A extends ValueSpecList> extends IBuilder<A> {
return new List({ return new List({
description: null, description: null,
warning: null, warning: null,
minLength: 0, minLength: null,
maxLength: null, maxLength: null,
type: "list" as const, type: "list" as const,
...value, ...value,

View File

@@ -56,17 +56,17 @@ export interface ValueSpecNumber extends ListValueSpecNumber, WithStandalone {
default: number | null; default: number | null;
} }
export interface ValueSpecColor extends WithStandalone { export interface ValueSpecColor extends WithStandalone {
type: "color" type: "color";
required: boolean; required: boolean;
default: string | null; default: string | null;
} }
export interface ValueSpecDatetime extends WithStandalone { export interface ValueSpecDatetime extends WithStandalone {
type: "datetime" type: "datetime";
required: boolean; required: boolean;
inputMode: 'date' | 'time' | 'datetime-local' inputMode: 'date' | 'time' | 'datetime-local';
min: string | null min: string | null;
max: string | null max: string | null;
step: string | null step: string | null;
default: string | null; default: string | null;
} }
export interface ValueSpecSelect extends SelectBase, WithStandalone { export interface ValueSpecSelect extends SelectBase, WithStandalone {
@@ -141,14 +141,14 @@ export interface ValueSpecListOf<T extends ListValueSpecType>
| readonly Record<string, unknown>[]; | readonly Record<string, unknown>[];
} }
export interface Pattern { export interface Pattern {
regex: string regex: string;
description: string description: string;
} }
export interface ListValueSpecText { export interface ListValueSpecText {
type: "text"; type: "text";
patterns: Pattern[] patterns: Pattern[];
minLength: number | null minLength: number | null;
maxLength: number | null maxLength: number | null;
masked: boolean; masked: boolean;
inputmode: "text" | "email" | "tel" | "url"; inputmode: "text" | "email" | "tel" | "url";
placeholder: string | null; placeholder: string | null;