From 9faa4eccfdcf8bbf3e7bb1eaf90db8e4a5f32da5 Mon Sep 17 00:00:00 2001 From: Stefan Zerkalica Date: Fri, 29 Sep 2023 15:53:36 +0300 Subject: [PATCH] $mol_select_list, review fixes --- check/list/list.view.tree | 2 +- check/list/list.view.ts | 8 ++++---- form/draft/demo/demo.view.tree | 6 +++--- form/draft/draft.view.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/check/list/list.view.tree b/check/list/list.view.tree index 14dc9ec2c60..34eaea9d37a 100644 --- a/check/list/list.view.tree +++ b/check/list/list.view.tree @@ -1,5 +1,5 @@ $mol_check_list $mol_view - options_checked * + dictionary_checked * Option* $mol_check checked? <=> option_checked*? false label <= option_label* / diff --git a/check/list/list.view.ts b/check/list/list.view.ts index 40d9b854a62..d6399ebfaed 100644 --- a/check/list/list.view.ts +++ b/check/list/list.view.ts @@ -10,18 +10,18 @@ namespace $.$$ { return {} } - override options_checked(next?: Record) { + override dictionary_checked(next?: Record) { return next ?? {} } override option_checked(id: string, next?: boolean | null) { - const prev = this.options_checked() - if (next === undefined) return prev[id] + const prev = this.dictionary_checked() + if (next === undefined) return prev[id] ?? null const next_rec = { ... prev, [id]: next } as Record if (next === null) delete next_rec[id] - return this.options_checked(next_rec)[id] + return this.dictionary_checked(next_rec)[id] ?? null } @ $mol_mem diff --git a/form/draft/demo/demo.view.tree b/form/draft/demo/demo.view.tree index 9015e7a88ac..52826111af5 100644 --- a/form/draft/demo/demo.view.tree +++ b/form/draft/demo/demo.view.tree @@ -21,7 +21,7 @@ $mol_form_draft_demo $mol_example submit? => publish? submit_allowed => publish_allowed value_str*? => value_str*? - value_arr_str*? => value_arr_str*? + list_string*? => list_string*? value_rec_bool*? => value_rec_bool*? changed => changed form_fields / @@ -61,7 +61,7 @@ $mol_form_draft_demo $mol_example <= Hobbies_field $mol_form_field name \Hobbies Content <= Hobbies $mol_check_list - options_checked? <=> value_rec_bool*hobbies? + dictionary_checked? <=> value_rec_bool*hobbies? options * programming \Programming bikinkg \Biking @@ -78,7 +78,7 @@ $mol_form_draft_demo $mol_example freeze \Mister Freeze clay \Clayface mask \Black Mask - value? <=> value_arr_str*friends? + value? <=> list_string*friends? body <= form_body / <= Title_field <= Config $mol_form_group sub / diff --git a/form/draft/draft.view.ts b/form/draft/draft.view.ts index 2aacd89d06a..f3cf5c4f154 100644 --- a/form/draft/draft.view.ts +++ b/form/draft/draft.view.ts @@ -32,7 +32,7 @@ namespace $.$$ { */ export class $mol_form_draft extends $.$mol_form_draft { @ $mol_mem_key - value_arr_str( field: string, next? : readonly string[] | null ) { + list_string( field: string, next? : readonly string[] | null ) { return this.value( field, next )?.map(norm_string) ?? [] }