From 137371f07153c358287f4c55f6e2b5c6fe2c0cec Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Thu, 20 Apr 2023 12:48:08 -0600 Subject: [PATCH] dont default minLength --- lib/config/builder/list.ts | 9 +++------ lib/config/configTypes.ts | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/config/builder/list.ts b/lib/config/builder/list.ts index bc9e94a..9f4d179 100644 --- a/lib/config/builder/list.ts +++ b/lib/config/builder/list.ts @@ -29,7 +29,6 @@ export class List extends IBuilder { warning?: string | null; /** Default = [] */ default?: string[]; - /** Default = 0 */ minLength?: number | null; maxLength?: number | null; }, @@ -58,7 +57,7 @@ export class List extends IBuilder { warning: null, default: [], type: "list" as const, - minLength: 0, + minLength: null, maxLength: null, ...a, spec, @@ -71,7 +70,6 @@ export class List extends IBuilder { warning?: string | null; /** Default = [] */ default?: string[]; - /** Default = 0 */ minLength?: number | null; maxLength?: number | null; }, @@ -96,7 +94,7 @@ export class List extends IBuilder { return new List({ description: null, warning: null, - minLength: 0, + minLength: null, maxLength: null, default: [], type: "list" as const, @@ -111,7 +109,6 @@ export class List extends IBuilder { warning?: string | null; /** Default [] */ default?: []; - /** Default = 0 */ minLength?: number | null; maxLength?: number | null; }, @@ -138,7 +135,7 @@ export class List extends IBuilder { return new List({ description: null, warning: null, - minLength: 0, + minLength: null, maxLength: null, type: "list" as const, ...value, diff --git a/lib/config/configTypes.ts b/lib/config/configTypes.ts index c49977c..fdaf537 100644 --- a/lib/config/configTypes.ts +++ b/lib/config/configTypes.ts @@ -56,17 +56,17 @@ export interface ValueSpecNumber extends ListValueSpecNumber, WithStandalone { default: number | null; } export interface ValueSpecColor extends WithStandalone { - type: "color" + type: "color"; required: boolean; default: string | null; } export interface ValueSpecDatetime extends WithStandalone { - type: "datetime" + type: "datetime"; required: boolean; - inputMode: 'date' | 'time' | 'datetime-local' - min: string | null - max: string | null - step: string | null + inputMode: 'date' | 'time' | 'datetime-local'; + min: string | null; + max: string | null; + step: string | null; default: string | null; } export interface ValueSpecSelect extends SelectBase, WithStandalone { @@ -141,14 +141,14 @@ export interface ValueSpecListOf | readonly Record[]; } export interface Pattern { - regex: string - description: string + regex: string; + description: string; } export interface ListValueSpecText { type: "text"; - patterns: Pattern[] - minLength: number | null - maxLength: number | null + patterns: Pattern[]; + minLength: number | null; + maxLength: number | null; masked: boolean; inputmode: "text" | "email" | "tel" | "url"; placeholder: string | null;